Skip to content

Commit

Permalink
Fix simplepie#116. mb_convert_encoding, if dealing with an unknown "f…
Browse files Browse the repository at this point in the history
…rom encoding", emits an E_WARNING and proceeds to convert from ISO-8859-1, which is whacky as hell.
  • Loading branch information
gsnedders committed Jun 18, 2009
1 parent ba73efb commit 343fdd2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions simplepie.inc
Expand Up @@ -9439,8 +9439,8 @@ class SimplePie_Misc
{
return SimplePie_Misc::windows_1252_to_utf8($data);
}
// This is second, as behaviour of this varies only with PHP version
elseif (function_exists('mb_convert_encoding') && ($return = @mb_convert_encoding($data, $output, $input)))
// This is second, as behaviour of this varies only with PHP version (the middle part of this expression checks the encoding is supported).
elseif (function_exists('mb_convert_encoding') && @mb_convert_encoding("\x80", 'UTF-16BE', $input) !== "\x00\x80" && ($return = @mb_convert_encoding($data, $output, $input)))
{
return $return;
}
Expand Down

0 comments on commit 343fdd2

Please sign in to comment.