Bug #74678 [Fbk->Nab]: mb_strtoupper() and mb_strtolower() are compleltly broken

From: Date: Wed, 31 May 2017 12:02:55 +0000
Subject: Bug #74678 [Fbk->Nab]: mb_strtoupper() and mb_strtolower() are compleltly broken
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-209317@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74678&edit=1 ID: 74678 Updated by: peehaa@php.net Reported by: spam2 at rhsoft dot net Summary: mb_strtoupper() and mb_strtolower() are compleltly broken -Status: Feedback +Status: Not a bug Type: Bug Package: mbstring related PHP Version: 7.1Git-2017-05-31 (Git) Block user comment: N Private report: N New Comment: As stated by OP not a bug, but a programming error. Previous Comments: ------------------------------------------------------------------------ [2017-05-31 11:47:17] 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 11:16:54] kelunik@php.net As Thomas already mentioned, please check your internal encoding setting. ------------------------------------------------------------------------ [2017-05-31 11:06:28] 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 10:55:21] 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 üöä üöä ������ ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74678&edit=1

« previous php.bugs (#209317) next »