From: Thorsten Schöning Date: Tue, 27 Nov 2012 14:50:15 +0000 (+0800) Subject: Bug 804093: Fix autodetected charset for windows-1252 encoded content X-Git-Tag: bugzilla-4.5.1~295 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9297dbbec65903d63fddf5878442c7886e45694c;p=thirdparty%2Fbugzilla.git Bug 804093: Fix autodetected charset for windows-1252 encoded content r=glob,a=LpSolit --- diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index 002f30ece6..9bdff77f38 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -763,12 +763,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; }