I18n problems: Working with double-byte languages

From: Date: Mon, 14 Jan 2002 20:18:15 +0000
Subject: I18n problems: Working with double-byte languages
Groups: php.general 
Request: Send a blank email to php-general+get-80486@lists.php.net to get a copy of this message
Hi people ! I have a query regarding double-byte languages on PHP. I need to sort a index localized from English to Korean. My idea is: * get the Korean strings from file; * convert them to UTF8; * insert them in a Oracle database set to work with UTF8; * set "NLS_LANG" with "Alter session" SQL command to this variable match with Korean language; * get the strings sorted by Oracle with a "SELECT * FROM table SORT BY field ASC" SQL command; I've tried to convert the Korean string to UTF8 with utf8_encode function, but this function converted each byte from double-byte string to its relative in UTF8 chars. Reverting this string encoded to UTF8 with utf8_decode function, the browser can display successfully the Korean chars (because the individual bytes of the double-byte string will be as them were before), but Oracle can't sort the strings properly because that UTF8 chars converted by utf8_encode function were not relative to a double-byte char, but relative to a 2 single bytes chars! How can I convert a double-byte string to UTF8 properly??? Really thanks !!!! _________________________________ Ricardo J. A. Júnior, Software Engineer Trainee Bowne Global Solutions Phone +55 21 2515 7713 ricardo.junior@bowneglobal.com.br <mailto:ricardo.junior@bowneglobal.com.br> www.bowneglobal.com.br <http://www.bowneglobal.com.br/>

« previous php.general (#80486) next »