ID: 47742 Updated by: j...@php.net Reported By: fsb at thefsb dot org Status: Feedback Bug Type: mbstring related Operating System: os x PHP Version: 5.2.9 New Comment:
Ignore the previous, this bad bug system messed up the input. :) Here's the actual stuff: http://pecl.php.net/~jani/bug47742.out Previous Comments: ------------------------------------------------------------------------ [2009-05-06 21:07:33] j...@php.net This script: <?php $s = 'Χιόνια, βροχές και θυελλώδεις άνεμοι συνθέτουν το'; echo "orig: $s\n"; $s = mb_strtoupper($s); echo "mb_strtoupper: $s\n"; $s = mb_convert_case($s, MB_CASE_UPPER, "UTF-8"); echo "mb_convert_case (upper): $s\n"; $s = mb_strtolower($s); echo "mb_strtolower: $s\n"; $s = mb_convert_case($s, MB_CASE_LOWER, "UTF-8"); echo "mb_convert_case (lower): $s\n"; ?> Outputs: orig: Χιόνια, βροχές και θυελλώδεις άνεμοι συνθέτουν το mb_strtoupper: ΧΙΌΝΙΑ, ΒΡΟΧΈΣ ΚΑΙ ΘΥΕΛΛΏΔΕΙΣ ΆΝΕΜΟΙ ΣΥΝΘΈΤΟΥΝ ΤΟ mb_convert_case (upper): ΧΙΌΝΙΑ, ΒΡΟΧΈΣ ΚΑΙ ΘΥΕΛΛΏΔΕΙΣ ΆΝΕΜΟΙ ΣΥΝΘΈΤΟΥΝ ΤΟ mb_strtolower: χιόνια, βροχέσ και θυελλώδεισ άνεμοι συνθέτουν το mb_convert_case (lower): χιόνια, βροχέσ και θυελλώδεισ άνεμοι συνθέτουν το And this is quite correct.. ------------------------------------------------------------------------ [2009-05-05 11:37:26] fsb at thefsb dot org in both test scripts i provided yesterday, the character set is unicode and the encoding is utf-8. in the short test script that i provided 4 May 7:02pm UTC, there is only one short Hangul test string and no Greek, as you said. in the longer test script i provided at 4 May 5:00pm UTC, several alphabets are used including Greek, Cyrillic, Hebrew, Arabic, Thai, Kanji, ... in case it makes life easier for you, i put the longer test script on a web server: http://tomworster.net/test.php.gz it's only 1kbyte. ------------------------------------------------------------------------ [2009-05-05 02:02:39] j...@php.net One last question: What is the charset you used? I don't see any greek chars anywhere.. ;) ------------------------------------------------------------------------ [2009-05-04 19:02:43] fsb at thefsb dot org <?php $s = 'ì´ë©° ì¸ê³'; print(phpversion() . "\n"); print("1: $s\n"); print('2: '. ($s = mb_strtoupper($s)) . "\n"); print('3'. ($s = mb_convert_case($s, MB_CASE_UPPER, "UTF-8")) . "\n"); print('4: '. ($s = mb_strtolower($s)) . "\n"); print('5: '. ($s = mb_convert_case($s, MB_CASE_LOWER, "UTF-8")) . "\n"); ?> ./php -f test2.php 5.2.10-dev 1: ì´ë©° ì¸ê³ 2: Ì?Ë©? Ì?ʳ? 3ÌË© Ìʳ 4: ?? ?? 5: expected output: 1: ì´ë©° ì¸ê³ 2: ì´ë©° ì¸ê³ 3: ì´ë©° ì¸ê³ 4: ì´ë©° ì¸ê³ 5: ì´ë©° ì¸ê³ ------------------------------------------------------------------------ [2009-05-04 18:46:54] j...@php.net Please provide a bit shorter example script. Or does the bug only appear with such long strings..? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/47742 -- Edit this bug report at http://bugs.php.net/?id=47742&edit=1