Re: PHP4.0.6, php_iconv bugs

From: Date: Fri, 10 Aug 2001 14:14:36 +0000
Subject: Re: PHP4.0.6, php_iconv bugs
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-62811@lists.php.net to get a copy of this message
["Piotr Pawlow" <pp@siedziba.pl>] > Hello, > > I have noticed that php_iconv sometimes fails to convert the string > due to invalid sequence of characters on input, and there is no way to > find out where the bad sequence is. I think there should be an > optional parameter added to iconv() function, a variable passed by > reference. If used, iconv would in case of an error return partially > converted string, and set this variable to character index at which > the conversion failed. > Also, php_iconv makes a wrong assumption that the longest sequence > representing one char is as long as sizeof(ucs4_t). For example, > unicode combined characters can easily be longer, the same applies to > encodings like 'JAVA' (\uNNNN). Did you test the same thing with another program using iconv? I've encountered the same problem in iconv when I tried to convert an ISO-8859-1 string containing "~" to Shift_JIS. Shift_JIS actually does not define the tilde character, so iconv bailed out and returned an empty string (the solution is using codepage 932 instead when people ask for Shift_JIS. Bleh.) - Stig -- Stig Sæther Bakken <ssb@alltheweb.com> Fast Search & Transfer ASA, Trondheim, Norway

« previous php.dev (#62811) next »