about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-04-09 09:07:16 +0000
committerEric Wong <e@80x24.org>2016-04-11 04:57:53 +0000
commit072a8bf4bc83f1e7b7b6f603ef0403a78ce991d1 (patch)
tree03a21e4557086e48f55f8062263d93683d16b4a7 /lib
parent2b673b707edc91f505836e567b690d0acd1120ff (diff)
downloadpublic-inbox-072a8bf4bc83f1e7b7b6f603ef0403a78ce991d1.tar.gz
Author names may have wide characters in them, so avoid warnings
as git favors UTF-8 for names and fast-import even requires them
for commit messages
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/Import.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm
index e2156f10..4c7bbf14 100644
--- a/lib/PublicInbox/Import.pm
+++ b/lib/PublicInbox/Import.pm
@@ -162,11 +162,16 @@ sub add {
         unless ($parent) {
                 print $w "reset $ref\n" or wfail;
         }
+
+        # quiet down wide character warnings:
+        binmode $w, ':utf8' or die "binmode :utf8 failed: $!";
         print $w "commit $ref\nmark :$commit\n",
                 "author $name <$email> $date\n",
                 "committer $self->{ident} ", now2822(), "\n",
                 "data ", (length($subject) + 1), "\n",
                 $subject, "\n\n" or wfail;
+        binmode $w, ':raw' or die "binmode :raw failed: $!";
+
         if ($tip ne '') {
                 print $w 'from ', ($parent ? $parent : $tip), "\n" or wfail;
         }