[PHP-DOC] #35068 [Opn]: iconv encoding names different on AIX
by Bjorn dot Wiberg at its dot uu dot se other posts by this author
Nov 2 2005 7:03AM messages near this date
[PHP-DOC] #35068 [Opn]: iconv encoding names different on AIX
|
[PHP-DOC] Boolean documentation
ID: 35068
User updated by: Bjorn dot Wiberg at its dot uu dot se
Reported By: Bjorn dot Wiberg at its dot uu dot se
Status: Open
Bug Type: Documentation problem
Operating System: AIX 5.2.0.0 ML6
PHP Version: Irrelevant
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[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#HD
RDNNRI49HOWA
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
Thread:
Bjorn dot Wiberg at its dot uu dot se
vrana
Bjorn dot Wiberg at its dot uu dot se
sniper
Bjorn dot Wiberg at its dot uu dot se
|