note 84719 modified in function.setlocale by danbrown

From: Date: Sun, 27 Jul 2008 15:37:59 +0000
Subject: note 84719 modified in function.setlocale by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-142811@lists.php.net to get a copy of this message
Note about using UTF-8 locale charset on Windows systems: According to MSDN, Windows setlocale()'s implementation does not support UTF-8 encoding. Citation from "MSDN setlocale, _wsetlocale" page (http://msdn.microsoft.com/en-us/library/x99tb11d.aspx): 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. So basically, code like <?php setlocale(LC_ALL, 'Czech_Czech Republic.65001'); // 65001 is UTF-8 codepage ?> does not work on Windows at all. (written in time of PHP 5.2.4) --was-- Note about using UTF-8 locale charset on Windows systems: According to MSDN, Windows setlocale()'s implementation does not support UTF-8 encoding. Citation from "MSDN setlocale, _wsetlocale" page (http://msdn.microsoft.com/en-us/library/x99tb11d.aspx): 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. So basically, code like <? setlocale(LC_ALL, 'Czech_Czech Republic.65001'); // 65001 is UTF-8 codepage ?> does not work on Windows at all. (written in time of PHP 5.2.4) http://php.net/manual/en/function.setlocale.php

« previous php.notes (#142811) next »