php.net |  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
 [2017-05-31 10:55 UTC] spam2 at rhsoft dot net
Description:
------------
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
<?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
üöä
üöä
������



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-05-31 11:06 UTC] subjective@php.net
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] kelunik@php.net
-Status: Open +Status: Feedback
 [2017-05-31 11:16 UTC] kelunik@php.net
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] peehaa@php.net
-Status: Feedback +Status: Not a bug
 [2017-05-31 12:02 UTC] peehaa@php.net
As stated by OP not a bug, but a programming error.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC