1--TEST--
2Test mb_strtolower() function : usage variations - pass different characters to check conversion is correct
3--EXTENSIONS--
4mbstring
5--FILE--
6<?php
7/*
8 * Pass accented characters and Russian characters to check case conversion is correct
9 */
10
11echo "*** Testing mb_strtolower() :  usage variations ***\n";
12
13$uppers = array('Basic Latin' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
14                'Characters With Accents' => base64_decode('w4DDgcOCw4PDhMOFw4bDh8OIw4nDisOLw4zDjcOOw4/DkMORw5LDk8OUw5XDlg=='),
15                'Russian' => base64_decode('0JDQkdCS0JPQlNCV0JbQlw=='));
16$lowers = array('Basic Latin' => 'abcdefghijklmnopqrstuvwxyz',
17                'Characters With Accents' => base64_decode('w6DDocOiw6PDpMOlw6bDp8Oow6nDqsOrw6zDrcOuw6/DsMOxw7LDs8O0w7XDtg=='),
18                'Russian' => base64_decode('0LDQsdCy0LPQtNC10LbQtw=='));
19
20foreach ($uppers as $lang => $sourcestring) {
21    echo "\n-- $lang --\n";
22    $a = mb_strtolower($sourcestring, 'utf-8');
23    var_dump(base64_encode($a));
24    if ($a == $lowers[$lang]) {
25        echo "Correctly Converted\n";
26    } else {
27        echo "Incorrectly Converted\n";
28    }
29}
30
31echo "Done";
32?>
33--EXPECT--
34*** Testing mb_strtolower() :  usage variations ***
35
36-- Basic Latin --
37string(36) "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo="
38Correctly Converted
39
40-- Characters With Accents --
41string(64) "w6DDocOiw6PDpMOlw6bDp8Oow6nDqsOrw6zDrcOuw6/DsMOxw7LDs8O0w7XDtg=="
42Correctly Converted
43
44-- Russian --
45string(24) "0LDQsdCy0LPQtNC10LbQtw=="
46Correctly Converted
47Done
48