This repository has been archived by the owner on Jan 8, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 49
Third argument of mb_convert_encoding() can be an array #51
Comments
can you please provide a patch? |
I have already tried to fix it but it does not seem to be trivial. Here are two examples where the conversion is no problem: // ISO-8859-1 to UTF-8
mb_convert_encoding(utf8_decode('déjà'), 'UTF-8', 'ISO-8859-1');
// ISO-2022-JP to UTF-8
mb_convert_encoding(mb_convert_encoding('漢字', 'ISO-2022-JP', 'UTF-8'), 'UTF-8', 'ISO-2022-JP'); We are using The PHP // <unknown> to UTF-8
mb_convert_encoding($filename, 'UTF-8', 'ASCII,ISO-2022-JP,UTF-8,EUC-JP,ISO-8859-1');
// the third argument can also be an array
mb_convert_encoding($filename, 'UTF-8', array('ASCII', 'ISO-2022-JP', 'UTF-8', 'EUC-JP', 'ISO-8859-1')); This still works fine with our two test cases from above: // ISO-8859-1 to UTF-8
mb_convert_encoding(utf8_decode('déjà'), 'UTF-8', 'ASCII,ISO-2022-JP,UTF-8,EUC-JP,ISO-8859-1');
// ISO-2022-JP to UTF-8
mb_convert_encoding(mb_convert_encoding('漢字', 'ISO-2022-JP', 'UTF-8'), 'UTF-8', 'ASCII,ISO-2022-JP,UTF-8,EUC-JP,ISO-8859-1'); But it does not work with the compatibility layer:
Any idea how to fix this? |
I have found a proper solution (see #52). |
@leofeyer note that HHVM doesn't accept an array as last argument. |
Does it accept a comma separated list? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
According to the PHP manual, the third argument of
mb_convert_encoding()
can be either a comma separated list or an array. The Mbstring class only handles the first case.The text was updated successfully, but these errors were encountered: