Doc #60647 [NEW]: Encoding for first parameter for idn_to_ascii is depnding on idn-setting

From: Date: Tue, 03 Jan 2012 21:14:46 +0000
Subject: Doc #60647 [NEW]: Encoding for first parameter for idn_to_ascii is depnding on idn-setting
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7721@lists.php.net to get a copy of this message
From: Operating system: Linux Debian PHP version: 5.3.8 Package: Documentation problem Bug Type: Documentation Problem Bug description:Encoding for first parameter for idn_to_ascii is depnding on idn-setting 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 bug report at https://bugs.php.net/bug.php?id=60647&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60647&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60647&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60647&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60647&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60647&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60647&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60647&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60647&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60647&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60647&r=support Expected behavior: https://bugs.php.net/fix.php?id=60647&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60647&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60647&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60647&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60647&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=60647&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60647&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60647&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60647&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60647&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60647&r=mysqlcfg

« previous php.doc.bugs (#7721) next »