Page 1 of 1

how to lowercase in the correct locale

Posted: Sun Jun 13, 2004 12:14 pm
by davidklonski
Hello

I have strings in different languages, all of them start with a capital letter (for those languages that support it).
Is there a locale-aware method to change those strings so that the first letter will be in lowercase?
The solution must be locale specific.

For example:
The string 'Écran' (Screen in English) will need to be converted to 'écran'.

thanks in advance

Posted: Sun Jun 13, 2004 12:17 pm
by feyd
try:

Code: Select all

html_entity_decode(strtolower(htmlentites($str,ENT_QUOTES)),ENT_QUOTES);

Posted: Sun Jun 13, 2004 12:30 pm
by davidklonski
I have found the following:

Code: Select all

mb_strtolower($string, $encoding);
I needed to make sure the php_mbstring.dll was included in php.ini

Posted: Sun Jun 13, 2004 12:33 pm
by feyd
I think mine should work on machines without that extension..