1--TEST--
2Test mb_strtoupper() function : basic functionality
3--EXTENSIONS--
4mbstring
5--FILE--
6<?php
7/*
8 * Test basic functionality of mb_strtoupper
9 */
10
11echo "*** Testing mb_strtoupper() : basic functionality ***\n";
12
13mb_internal_encoding('utf-8');
14$ascii_lower = 'abcdefghijklmnopqrstuvwxyz';
15$ascii_upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
16$greek_lower = base64_decode('zrHOss6zzrTOtc62zrfOuM65zrrOu868zr3Ovs6/z4DPgc+Dz4TPhc+Gz4fPiM+J');
17$greek_upper = base64_decode('zpHOks6TzpTOlc6WzpfOmM6ZzprOm86czp3Ons6fzqDOoc6jzqTOpc6mzqfOqM6p');
18
19echo "\n-- ASCII String --\n";
20$ascii = mb_strtoupper($ascii_lower);
21var_dump(base64_encode($ascii));
22
23if($ascii == $ascii_upper) {
24    echo "Correctly converted\n";
25} else {
26    echo "Incorrectly converted\n";
27}
28
29echo "\n-- Multibyte String --\n";
30$mb = mb_strtoupper($greek_lower, 'UTF-8');
31var_dump(base64_encode($mb));
32
33if ($mb == $greek_upper) {
34    echo "Correctly converted\n";
35} else {
36    echo "Incorrectly converted\n";
37}
38
39echo "Done";
40?>
41--EXPECT--
42*** Testing mb_strtoupper() : basic functionality ***
43
44-- ASCII String --
45string(36) "QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVo="
46Correctly converted
47
48-- Multibyte String --
49string(64) "zpHOks6TzpTOlc6WzpfOmM6ZzprOm86czp3Ons6fzqDOoc6jzqTOpc6mzqfOqM6p"
50Correctly converted
51Done
52