Re: [PHP-I18N] PHP support of Unicode?
[email protected] (Rasmus Lerdorf) Sat, 03 Oct 2009 12:58:36 -0400
| Newsgroups | php.i18n |
|---|---|
| Message-ID | <[email protected]> |
Gunnar Vestergaard wrote: > When using PHP, writing content in my local language and my neighbouring > contries' language, ISO 8859-1 has been sufficient as a character > encoding. But using PHP with other languages, is that possible? I mean, > does PHP support Unicode at present time? As I understand it, the > following statement is true: > "PHP supports Unicode only as long as it is encoded as UTF-8" > > Is that correct, or does PHP also support UTF-16? It depends what you are doing. PCRE, our regex library, only speaks UTF-8 and there are functions like json_encode() that assume utf-8 as well. If you are just doing pass-through stuff, you can use whatever you want. It is only if you want to manipulate the text in some manner that you need to worry about the encoding. -Rasmus