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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: svecpetr at email dot cz
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Wed May 29 03:01:29 2024 UTC