]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/IMAP.pm
eml: header_raw converts octets to Perl UTF-8
[public-inbox.git] / lib / PublicInbox / IMAP.pm
index 1f65aa650e2954e2a43b8549fabf33c829c00f41..37317948490234f0c9ce2dc75f5bacc4541501ea 100644 (file)
@@ -426,8 +426,10 @@ sub _esc ($) {
        if (!defined($v)) {
                'NIL';
        } elsif ($v =~ /[{"\r\n%*\\\[]/) { # literal string
+               utf8::encode($v);
                '{' . length($v) . "}\r\n" . $v;
        } else { # quoted string
+               utf8::encode($v);
                qq{"$v"}
        }
 }