ID: 35068 Updated by: [EMAIL PROTECTED] Reported By: Bjorn dot Wiberg at its dot uu dot se -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: AIX 5.2.0.0 ML6 PHP Version: Irrelevant New Comment:
This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. "Some systems (like IBM AIX) use "ISO8859-1" instead of "ISO-8859-1" so this value has to be used in configuration options and function parameters." Previous Comments: ------------------------------------------------------------------------ [2005-11-02 18:03:23] Bjorn dot Wiberg at its dot uu dot se Hello sniper! I agree with you (and understand if you'd rather not "patch" for this), although these kind of quirks seem to appear all the time with OSes from the "big" companies... :-/ In any case, it may be worth pointing out in the documentation, at least, so that people will be aware of this difference. Thanks in advance! Best regards, Björn ------------------------------------------------------------------------ [2005-11-02 17:00:44] [EMAIL PROTECTED] It's pretty idiotic by IBM to do that. Why not tell them to fix their crap? ------------------------------------------------------------------------ [2005-11-02 16:03:31] Bjorn dot Wiberg at its dot uu dot se Perhaps it would be possible to make sure that php.ini-dist and php.ini-recommended (and the default values in PHP, for the situation where no php.ini is found) get modified on AIX upon ./configure, testing or installation, unless GNU libiconv is found? php -i reports the following under AIX by default (no php.ini is in place here so the local and master values are equal). ---8<--- phpinfo() PHP Version => 5.0.5 /../ Configuration File (php.ini) Path => /apache/php/lib /../ iconv iconv support => enabled iconv implementation => unknown iconv library version => unknown Directive => Local Value => Master Value iconv.input_encoding => ISO-8859-1 => ISO-8859-1 iconv.internal_encoding => ISO-8859-1 => ISO-8859-1 iconv.output_encoding => ISO-8859-1 => ISO-8859-1 --->8--- Best regards, Björn ------------------------------------------------------------------------ [2005-11-02 15:51:07] Bjorn dot Wiberg at its dot uu dot se Description: ------------ Under IBM AIX, using the IBM-shipped version of libiconv (package bos.rte.iconv) requires one to use "ISO8859-1" instead of "ISO-8859-1" in the call to iconv() when dealing with ISO latin-1 character set conversions. Probably one should set iconv.input_encoding, iconv.internal_encoding and iconv.output_encoding to "ISO8859-1" as well, in php.ini or the Apache server configuration (to override the default values of "ISO-8859-1"). Other similar cases seem to be present, see: http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/genprogc/convert_prg.htm#HDRDNNRI49HOWA This may be worth to point out in the PHP iconv documentation: http://www.php.net/iconv Furthermore, this may very well be the cause for the iconv tests failing under AIX. Reproduce code: --------------- The package origin of the libiconv.a file is given by: $ lslpp -w /usr/lib/libiconv.a File Fileset Type ---------------------------------------------------------------------------- /usr/lib/libiconv.a bos.rte.iconv File Version information is given by: $ lslpp -la | grep iconv bos.iconv.com 5.2.0.0 COMMITTED Common Language to Language bos.iconv.ucs.com 5.2.0.0 COMMITTED Unicode Base Converters for bos.rte.iconv 5.2.0.0 COMMITTED Language Converters Working PHP code for translating some Swedish characters in character set ISO8859-1 to UTF-8: <?php if (function_exists('iconv')) { $namn = iconv('ISO8859-1', 'UTF-8', "åäö"); echo "Result: $namn"; } ?> Using "ISO-8859-1" does not work! Excerpt from 'make test': ===================================================================== FAILED TEST SUMMARY --------------------------------------------------------------------- /../ iconv() test 1 [ext/iconv/tests/iconv001.phpt] iconv_mime_encode() sanity cheeck. [ext/iconv/tests/iconv004.phpt] iconv_mime_decode() [ext/iconv/tests/iconv_mime_decode.phpt] iconv_mime_decode_headers() [ext/iconv/tests/iconv_mime_decode_headers.phpt] iconv_mime_encode() [ext/iconv/tests/iconv_mime_encode.phpt] iconv stream filter [ext/iconv/tests/iconv_stream_filter.phpt] iconv_strlen() [ext/iconv/tests/iconv_strlen.phpt] iconv_strpos() [ext/iconv/tests/iconv_strpos.phpt] iconv_strrpos() [ext/iconv/tests/iconv_strrpos.phpt] iconv_substr() [ext/iconv/tests/iconv_substr.phpt] /../ Actual result: -------------- iconv() returning FALSE when the conversion fails (due to "incorrect" encoding specified). ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35068&edit=1