From: Bjorn dot Wiberg at its dot uu dot se Operating system: AIX 5.2.0.0 ML6 PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: iconv encoding names different on AIX
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 bug report at http://bugs.php.net/?id=35068&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35068&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=35068&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=35068&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=35068&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=35068&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=35068&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=35068&r=needscript Try newer version: http://bugs.php.net/fix.php?id=35068&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=35068&r=support Expected behavior: http://bugs.php.net/fix.php?id=35068&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=35068&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=35068&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=35068&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35068&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=35068&r=dst IIS Stability: http://bugs.php.net/fix.php?id=35068&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=35068&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=35068&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=35068&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=35068&r=mysqlcfg