1--TEST-- 2Test mb_strtoupper() function : usage varitations - Pass different character types to check conversion is correct 3--SKIPIF-- 4<?php 5extension_loaded('mbstring') or die('skip'); 6function_exists('mb_strtoupper') or die("skip mb_strtoupper() is not available in this build"); 7?> 8--FILE-- 9<?php 10/* 11 * Pass characters from different languages to check that mb_strtoupper is 12 * doing a correct case conversion 13 */ 14 15echo "*** Testing mb_strtoupper() : usage variations ***\n"; 16 17$uppers = array('Basic Latin' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 18 'Characters With Accents' => base64_decode('w4DDgcOCw4PDhMOFw4bDh8OIw4nDisOLw4zDjcOOw4/DkMORw5LDk8OUw5XDlg=='), 19 'Russian' => base64_decode('0JDQkdCS0JPQlNCV0JbQlw==')); 20$lowers = array('Basic Latin' => 'abcdefghijklmnopqrstuvwxyz', 21 'Characters With Accents' => base64_decode('w6DDocOiw6PDpMOlw6bDp8Oow6nDqsOrw6zDrcOuw6/DsMOxw7LDs8O0w7XDtg=='), 22 'Russian' => base64_decode('0LDQsdCy0LPQtNC10LbQtw==')); 23 24foreach ($lowers as $lang => $sourcestring) { 25 echo "\n-- $lang --\n"; 26 $a = mb_strtoupper($sourcestring, 'UTF-8'); 27 var_dump(base64_encode($a)); 28 if ($a == $uppers[$lang]) { 29 echo "Correctly Converted\n"; 30 } else { 31 echo "Incorrectly Converted\n"; 32 } 33} 34 35echo "Done"; 36?> 37--EXPECT-- 38*** Testing mb_strtoupper() : usage variations *** 39 40-- Basic Latin -- 41string(36) "QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVo=" 42Correctly Converted 43 44-- Characters With Accents -- 45string(64) "w4DDgcOCw4PDhMOFw4bDh8OIw4nDisOLw4zDjcOOw4/DkMORw5LDk8OUw5XDlg==" 46Correctly Converted 47 48-- Russian -- 49string(24) "0JDQkdCS0JPQlNCV0JbQlw==" 50Correctly Converted 51Done 52