Bug #52910 [Opn->Bgs]: PHP iconv() behaves differently than "iconv" command

From: Date: Thu, 23 Sep 2010 00:59:57 +0000
Subject: Bug #52910 [Opn->Bgs]: PHP iconv() behaves differently than "iconv" command
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-154580@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=52910&edit=1

 ID:                 52910
 Updated by:         cataphract@php.net
 Reported by:        ms419 at freezone dot co dot uk
 Summary:            PHP iconv() behaves differently than "iconv" command
-Status:             Open
+Status:             Bogus
 Type:               Bug
 Package:            ICONV related
 Operating System:   Debian unstable
 PHP Version:        5.3SVN-2010-09-22 (snap)
 Block user comment: N

 New Comment:

LC_ALL is only affecting "echo".

You must do:

LC_ALL=C iconv -f utf-8 -t ascii//TRANSLIT 

Closing as bogus as this is almost certainly the cause of the problem.


Previous Comments:
------------------------------------------------------------------------
[2010-09-23 00:37:13] ms419 at freezone dot co dot uk

Description:
------------
I confirmed that both PHP and the "iconv" command use glibc

In the POSIX ("C") locale, "iconv" successfully transliterates "e"
with
an accent ("\xc3\xa9") to "e" with no accent,

$ LC_ALL=C echo -e "\xc3\xa9" | iconv -f utf-8 -t ascii//TRANSLIT 
e
$ 

 - however in the same locale, PHP iconv() fails to transliterate "e"
with an accent,

$ LC_ALL=C sapi/cli/php -r 'var_dump(iconv("utf-8", "ascii//TRANSLIT",
"\xc3\xa9"));'
string(1) "?"
$ 




------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52910&edit=1


Thread (2 messages)

« previous php.bugs (#154580) next »