]> git.donarmstrong.com Git - debbugs.git/commitdiff
if the charset is unknown, assume UTF-8
authorDon Armstrong <don@donarmstrong.com>
Thu, 8 Feb 2018 04:08:23 +0000 (20:08 -0800)
committerDon Armstrong <don@donarmstrong.com>
Thu, 8 Feb 2018 04:08:23 +0000 (20:08 -0800)
Debbugs/UTF8.pm

index 999fc8a48fd6197b22261535e1e2d7292655a4a9..01351f3668f04e2e33704eb672300006bf656579 100644 (file)
@@ -154,6 +154,10 @@ sub convert_to_utf8 {
     if ($charset eq 'RAW') {
         croak("Charset must not be raw when calling convert_to_utf8");
     }
+    ## if the charset is unknown or unknown 8 bit, assume that it's UTF-8.
+    if ($charset =~ /unknown/i) {
+       $charset = 'UTF-8'
+    }
     my $iconv_converter;
     eval {
         $iconv_converter = Text::Iconv->new($charset,"UTF-8") or