|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-08-11 11:19 UTC] stronk7 at moodle dot org
Description: ------------ I'm using iconv (with the //TRANSLIT option enabled in order to convert from a lot of different encodings to UTF-8. Everything seems to be working fine, but I've found one situation where, perhaps, //TRANSLIT isn't working properly. It happens when I'm trying to convert from euc-jp to utf-8 and the string contains some 0xA0 chars. All the string is english text, but with some spaces between words using the 0xA0 char (instead of the correct 0x20 char). I'm not an expert about euc-jp but it seems that the 0xA0 char hasn't meaning at all in that encoding. http://lfw.org/text/jp.html#euc Perhaps it shouldn't break the conversion process, at least when running under //TRANSLIT mode? The //IGNORE mode seems to work ok, ignoring such character. If I read the documentatio well it seems that //TRANSLIT should transform such character (hopefully to one space, if I'm not wrong). PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 19:00:02 2025 UTC |
Here it's an example script: <?php echo phpversion(); $original = 'Hello' . chr(240) . 'World'; $result = iconv('EUC-JP', 'UTF-8//TRANSLIT', $original); echo $result; ?> IMO, it should return: "Hello?World" (or, if I'm not wrong, "Hello World") instead it returns "Hello" and stops, where the TRANSLIST mode should make it arrive to the end.