]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Smsg.pm
smsg: handle wide characters in raw mail headers
[public-inbox.git] / lib / PublicInbox / Smsg.pm
index aaf88f355e60952291226aefba9ae970e369a609..62cb951eb9603e92376e6bd3318a922b9f830d4e 100644 (file)
@@ -105,6 +105,9 @@ sub populate {
                # to protect git and NNTP clients
                $val =~ tr/\0\t\n/   /;
 
+               # rare: in case headers have wide chars (not RFC2047-encoded)
+               utf8::decode($val);
+
                # lower-case fields for read-only stuff
                $self->{lc($f)} = $val;