<b>$s</b>\n
EOM
$ctx->zmore($bdy);
- open $fh, '<', "$tmp/p" or die "open $tmp/p: $!";
+ open $fh, '<:utf8', "$tmp/p" or die "open $tmp/p: $!";
if (-s $fh > $MAX_SIZE) {
$ctx->zmore("---\n patch is too large to show\n");
} else { # prepare flush_diff:
# a patch embedded inside the commit message body doesn't get fed
# to patch-id:
my $cmd = [ '/bin/sh', '-c',
- "git show '$SHOW_FMT' -z --no-notes --no-patch $oid >h && ".
- "git show --pretty=format:%n -M --stat -p $oid >p && ".
+ "git show --encoding=UTF-8 '$SHOW_FMT'".
+ " -z --no-notes --no-patch $oid >h && ".
+ 'git show --encoding=UTF-8 --pretty=format:%n -M'.
+ " --stat -p $oid >p && ".
"git patch-id --stable <p" ];
my $xenv = { GIT_DIR => $git->{git_dir} };
my $tmp = File::Temp->newdir("show-$oid-XXXX", TMPDIR => 1);
#!perl -w
-# Copyright (C) 2019-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
use strict;
use v5.10.1;
is($res->content, "\0" x $size,
"$label content matches");
}
+ my $utf8 = 'e022d3377fd2c50fd9931bf96394728958a90bf3';
+ $res = $cb->(GET("/$name/$utf8/s/"));
+ is($res->code, 200, 'shows commit w/ utf8.eml');
+ like($res->content, qr/Eléanor/,
+ 'UTF-8 commit shown properly');
};
test_psgi(sub { $www->call(@_) }, $client);
SKIP: {