Table of contents Home page
mb_internal_encoding('UTF-8'); $x = 'über'; echo "Conversion of '$x' to '" . mb_strtoupper($x) . "'.\n";
mb_internal_encoding('UTF-8'); $x = "\xfcber"; // String encoded in ISO-8859-1 echo mb_convert_encoding("Conversion of '$x' to '" . mb_strtoupper($x, 'ISO-8859-1'), 'UTF-8', 'ISO-8859-1') . "'.\n"; // Because we've explicitly specified the encoding used for the string (ISO-8859-1), which is different from the // internal encoding (UTF-8), mb_strtouopper() still converts the string to uppercase correctly. // Note that we assume that the output must be send in UTF-8, so we convert the result of mb_strtoupper() from // ISO-8859-1 to UTF-8, using mb_convert_encoding(), to have the string displayed correctly.