]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: note we assume UTF-8 on unknown encodings
authorEric Wong <e@yhbt.net>
Sat, 4 Apr 2020 08:03:15 +0000 (08:03 +0000)
committerEric Wong <e@yhbt.net>
Sat, 4 Apr 2020 23:34:25 +0000 (23:34 +0000)
Clarify that we're assuming the text is UTF-8, since users
may have no idea how it's mangled.

lib/PublicInbox/View.pm

index 70c10604e246ec23314d66580a01bd8b54ac7560..d897aeecc3ed3abf6ba2dc71bb9540cbf3ec0bdd 100644 (file)
@@ -518,7 +518,9 @@ sub attach_link ($$$$;$) {
        my $rv = $ctx->{obuf};
        $$rv .= qq($nl<a\nhref="$ctx->{mhref}$idx-$sfn">);
        if ($err) {
        my $rv = $ctx->{obuf};
        $$rv .= qq($nl<a\nhref="$ctx->{mhref}$idx-$sfn">);
        if ($err) {
-               $$rv .= "[-- Warning: decoded text below may be mangled --]\n";
+               $$rv .= <<EOF;
+[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
+EOF
        }
        $$rv .= "[-- Attachment #$idx: ";
        my $ts = "Type: $ct, Size: $size bytes";
        }
        $$rv .= "[-- Attachment #$idx: ";
        my $ts = "Type: $ct, Size: $size bytes";