Intl extension for Unicode support
suggest changeNative string functions operate on bytes, so they do not work well with Unicode. The iconv and mbstring extensions cover some of that. The Intl extension wraps the ICU library, the de facto standard. See the ICU site for details that are not in the Intl manual. If the extension cannot be installed, see Symfony's Intl component.
ICU offers full Internationalization of which Unicode is only a smaller part. You can do transcoding easily:
\UConverter::transcode($sString, 'UTF-8', 'UTF-8'); // illegal sequences are replaced, not removed, unless a callback option says otherwise
But, do not dismiss iconv just yet, consider:
\iconv('UTF-8', 'ASCII//TRANSLIT', "Cliƫnt"); // often "Client"; the transliteration depends on iconv and the locale
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents