]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 804093: Fix autodetected charset for windows-1252 encoded content
authorThorsten Schöning <tschoening@am-soft.de>
Tue, 27 Nov 2012 14:51:27 +0000 (22:51 +0800)
committerByron Jones <bjones@mozilla.com>
Tue, 27 Nov 2012 14:51:27 +0000 (22:51 +0800)
r=glob,a=LpSolit

Bugzilla/Util.pm

index c06496d6c4138a2538fb22ac757f1b114ae8c619..ee8674b726ccd67f4a44f910c0beb614d2ca63b9 100644 (file)
@@ -779,12 +779,12 @@ sub detect_encoding {
     }
 
     # Encode::Detect sometimes mis-detects various ISO encodings as iso-8859-8,
-    # but Encode::Guess can usually tell which one it is.
-    if ($encoding && $encoding eq 'iso-8859-8') {
+    # or cp1255, but Encode::Guess can usually tell which one it is.
+    if ($encoding && ($encoding eq 'iso-8859-8' || $encoding eq 'cp1255')) {
         my $decoded_as = _guess_iso($data, 'iso-8859-8', 
             # These are ordered this way because it gives the most 
             # accurate results.
-            qw(iso-8859-7 iso-8859-2));
+            qw(cp1252 iso-8859-7 iso-8859-2));
         $encoding = $decoded_as if $decoded_as;
     }