Update on strcoll() UTF-8 issue

December 8, 2008 at 11:45 1 comment

I just stumpled upon a comment in the Zend Framework Issue Tracker about an UTF-8 issue with PHP on Windows (the issue was about some problem within Zend_Ldap)  which pointed to a MSDN page about setlocale and _wsetlocale. It’s clearly stated there that the CRT function setlocale() does not work with multi-byte charsets on Windows:

The set of available languages, country/region codes, and code pages includes all those supported by the Win32 NLS API except code pages that require more than two bytes per character, such as UTF-7 and UTF-8. If you provide a code page like UTF-7 or UTF-8, setlocale will fail, returning NULL. The set of language and country/region codes supported by setlocale is listed in Language and Country/Region Strings.

That means that setlocale() does not work on Windows when given a locale with an UTF-8 charset, e.g. German_Germany.65001, and therfore you cannot use strcoll() or similar functions for locale-aware string operations with these charsets. It simply is not possible due to a Windows CRT limitation.

About these ads

Entry filed under: PHP. Tags: , .

How to use the new Zend_Ldap functionality Screenshots of game sheets-app for Eishockey.net

1 Comment Add your own

  • 1. Update on strcoll() UTF-8 issue | PHP-Blog.com  |  December 8, 2008 at 17:45

    [...] posted here: Update on strcoll() UTF-8 issue Related ArticlesBookmarksTags Alot has happened recently :) Update time! Andrew is a [...]

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Current articles

Twitter

  • RT @_md: Symfony is such an asset for the PHP community. Thank you Symfony developers for your amazing contribution! 2 weeks ago
  • RT @CompSciFact: 'The purpose of abstraction is not to be vague, but to create a new semantic level in which one can be absolutely precise'… 1 month ago
  • @DB_Bahn Gibt es dafür ein Formular oder wie funktioniert das? 1 month ago
  • @DB_Bahn Auch dann, wenn ich mit dem Privat-PKW fahren muss? 1 month ago
  • @DB_Bahn und wer bezahlt mit jetzt das Taxi nach Heilbronn? 1 month ago

del.icio.us

Certification


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: