|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74678 mb_strtoupper() and mb_strtolower() are compleltly broken
Submitted: 2017-05-31 10:55 UTC Modified: 2017-05-31 12:02 UTC
From: spam2 at rhsoft dot net Assigned:
Status: Not a bug Package: mbstring related
PHP Version: 7.1Git-2017-05-31 (Git) OS:
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.
Block user comment
Status: Assign to:
Bug Type:
From: spam2 at rhsoft dot net
New email:
PHP Version: OS:


 [2017-05-31 10:55 UTC] spam2 at rhsoft dot net
bad enough that mb_strtoupper() don't work at all but that mb_strtolower() destroys the string is a no-go

[harry@rh:/downloads]$ cat test.php
$mb_test = utf8_encode(chr(252) . chr(246) . chr(228));
echo "$mb_test\n";
$mb_test = mb_strtoupper($mb_test);
echo "$mb_test\n";
$mb_test = mb_strtolower($mb_test);
echo "$mb_test\n";

[harry@rh:/downloads]$ php test.php


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-05-31 11:06 UTC]
Have you checked the value of mb_internal_encoding()? You do not provide an encoding so it depends on the configuration. I suggest to provide the encoding argument to the function calls.

$mb_test = mb_strtoupper($mb_test, 'UTF-8');
 [2017-05-31 11:16 UTC]
-Status: Open +Status: Feedback
 [2017-05-31 11:16 UTC]
As Thomas already mentioned, please check your internal encoding setting.
 [2017-05-31 11:47 UTC] spam2 at rhsoft dot net
indeed - it needs UTF8 as explicit param - sorry for the noise - i am about writing "profile guided optimization" code-coverage for our PHP build and extend it to verify the behavior of important functions instead only blind calls for collecting profile informations
 [2017-05-31 12:02 UTC]
-Status: Feedback +Status: Not a bug
 [2017-05-31 12:02 UTC]
As stated by OP not a bug, but a programming error.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 22 15:01:29 2024 UTC