Edit report at https://bugs.php.net/bug.php?id=61484&edit=1
ID: 61484
User updated by: juzna dot cz at gmail dot com
Reported by: juzna dot cz at gmail dot com
Summary: iconv //IGNORE option doesn't work anymore in PHP5.4
Status: Open
Type: Bug
Package: ICONV related
Operating System: Ubuntu
PHP Version: 5.4.0
Block user comment: N
Private report: N
New Comment:
The //ignore option is still broken as of the latest stable release (5.4.3).
From reading some of the other bug reports on this, apparently new versions of iconv no longer
support the //ignore option, and instead -c must be passed. So PHP needs to detect the //ignore
option and in that case pass the "-c" option to iconv.
Previous Comments:
------------------------------------------------------------------------
[2012-03-25 08:15:33] laruence@php.net
@rasmus yes, 5.3 and 5.4 behavior inconsistently, that is because icovn doesn't
accept //IGNORE anymore, and now return -1, then comes a bug(see #52211), felipe
fixed this in 5.4, but didn't fix 5.3. so now, 5.3 and 5.4 behave differently,
but the fundamental reason seems still is the glibc change their iconv behavior.
thanks, :)
------------------------------------------------------------------------
[2012-03-23 07:14:31] rasmus@php.net
Not sure this is a libc thing. 5.3 and 5.4 on the same libc behave differently.
They both report:
iconv implementation => glibc
iconv library version => 2.13
------------------------------------------------------------------------
[2012-03-23 07:11:09] laruence@php.net
see http://sources.redhat.com/bugzilla/show_bug.cgi?id=13518
------------------------------------------------------------------------
[2012-03-23 07:01:36] laruence@php.net
this should be a issue of glibc, but I am not sure since when it has been
changed. :(
------------------------------------------------------------------------
[2012-03-22 23:59:36] juzna dot cz at gmail dot com
Description:
------------
When adding "//IGNORE" to target encoding in iconv function, wrong characters
should be skipped. This worked in PHP 5.3, but doesn't work anymore in 5.4.
I just compiled 5.3.10, where it works fine. Doesn't work on 5.4.0 nor on 5.4.1-
RC1.
Test script:
---------------
var_dump(iconv('UTF-8', 'UTF-16//IGNORE',
"\xc5\xbea\x01b\xed\xa0\x80c\xef\xbb\xbfd\xf4\x90\x80\x80e"));
Expected result:
----------------
string(18) "��~abc��de"
Actual result:
--------------
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61484&edit=1