php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49232 strtolower and utf-8 charaters with diacritics
Submitted: 2009-08-12 10:41 UTC Modified: 2009-08-13 08:46 UTC
From: svecpetr at email dot cz Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5.3.0 OS: linux
Private report: No CVE-ID: None
 [2009-08-12 10:41 UTC] svecpetr at email dot cz
Description:
------------
function strtolower doesn't work good

when try to lower Czech characters (with diacritics) written in utf-8 





Reproduce code:
---------------
try this

setlocale(LC_ALL, "cs_CZ.utf8");
$str = "?̊?؎?????ύ??";
echo strtolower($str);

// correct output is: 
//      ???????????????
// but you will see something else



Expected result:
----------------
correct function

Actual result:
--------------
see example above

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-12 11:31 UTC] sjoerd-php at linuxonly dot nl
Thank you for your bug report.

You can use mb_strtolower() to solve your problem.
 [2009-08-13 08:46 UTC] jani@php.net
PHP 6 will have unicode support. Until that, use mbstring.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 13:01:35 2025 UTC