Re: I18n problems: Working with double-byte languages
| From: | Yasuo Ohgaki | Date: | Tue, 15 Jan 2002 08:42:35 +0000 |
| Subject: | Re: I18n problems: Working with double-byte languages | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-80524@lists.php.net to get a copy of this message | ||
Ricardo Junior wrote:
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 !!!!UTF-8 works but EUC-KR may be better. Anyway, take a look at mbstring, iconv, gettext modules. -- Yasuo Ohgaki