Doc #60647 [Com]: Encoding for first parameter for idn_to_ascii is depnding on idn-setting
| From: | simonsimcity at gmail dot com | Date: | Tue, 03 Jan 2012 21:27:11 +0000 |
| Subject: | Doc #60647 [Com]: Encoding for first parameter for idn_to_ascii is depnding on idn-setting | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-7723@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60647&edit=1
ID: 60647
Comment by: simonsimcity at gmail dot com
Reported by: simonsimcity at gmail dot com
Summary: Encoding for first parameter for idn_to_ascii is
depnding on idn-setting
Status: Open
Type: Documentation Problem
Package: Documentation problem
Operating System: Linux Debian Lenny
PHP Version: 5.3.8
Block user comment: N
Private report: N
New Comment:
Please change the "ISO-8891-1" strings to "ISO_8859-1" :) This is correct for
Latin-1.
Previous Comments:
------------------------------------------------------------------------
[2012-01-03 21:20:44] simonsimcity at gmail dot com
Sorry .. I forgot to add the LibIDN-Version: 1.18
------------------------------------------------------------------------
[2012-01-03 21:14:45] simonsimcity at gmail dot com
Description:
------------
Currently the documentation for the function idn_to_ascii describes the first parameter as
following:
>> Domain to convert. In PHP 5 must be UTF-8 encoded.
The truth is that this value do not have to be encoded in UTF-8. The encoding of this string depends
on the setting of idn.default_charset
This setting by default is set to ISO-8891-1 and therefore a string containing a utf8-encoded
character that's invalid in ISO-8891-1 will cause the parser to crash (ending up in an
"segmentation fault" message).
Try the test-script once with the ini-value idn.default_charset of "ISO-8891-1" and once
of "utf-8". Using the default-value (iso-8891-1) the script will break and using
"utf-8" instead it will work as expected.
Test script:
---------------
<?php
var_dump( idn_to_ascii('Ó') );
echo "123";
Expected result:
----------------
PHP Notice: IDN_IDNA_TO_ASCII: Could not convert from IDNA to ASCII in /var/www/index.php on line 1
123
Actual result:
--------------
PHP Notice: IDN_IDNA_TO_ASCII: Could not convert from IDNA to ASCII in /var/www/index.php on line 1
Segmentation fault
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60647&edit=1