????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 52.14.150.165 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/home/b8009/php-5.6.22/ext/mbstring/tests/ |
Upload File : |
--TEST-- Test mb_convert_encoding() function : basic functionality --SKIPIF-- <?php extension_loaded('mbstring') or die('skip'); function_exists('mb_convert_encoding') or die("skip mb_convert_encoding() is not available in this build"); ?> --FILE-- <?php /* Prototype : string mb_convert_encoding(string $str, string $to_encoding [, mixed $from_encoding]) * Description: Returns converted string in desired encoding * Source code: ext/mbstring/mbstring.c */ /* * Test basic functionality of mb_convert_encoding() */ echo "*** Testing mb_convert_encoding() : basic functionality ***\n"; //All strings are the same when displayed in their respective encodings $sjis_string = base64_decode('k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg=='); $jis_string = base64_decode('GyRCRnxLXDhsJUYlLSU5JUgkRyQ5ISMbKEIwMTIzNBskQiM1IzYjNyM4IzkhIxsoQg=='); $euc_jp_string = base64_decode('xvzL3LjspcalraW5pcikx6S5oaMwMTIzNKO1o7ajt6O4o7mhow=='); $utf8_string = base64_decode('5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII='); echo "\n-- Convert to JIS --\n"; echo "JIS encoded string in base64:\n"; var_dump(base64_encode($jis_string)); echo "Converted Strings:\n"; var_dump(base64_encode(mb_convert_encoding($sjis_string, 'JIS', 'SJIS'))); var_dump(base64_encode(mb_convert_encoding($euc_jp_string, 'JIS', 'EUC-JP'))); var_dump(base64_encode(mb_convert_encoding($utf8_string, 'JIS', 'UTF-8'))); echo "\n-- Convert to EUC-JP --\n"; echo "EUC-JP encoded string in base64:\n"; var_dump(base64_encode($euc_jp_string)); echo "Converted Strings:\n"; var_dump(base64_encode(mb_convert_encoding($sjis_string, 'EUC-JP', 'SJIS'))); var_dump(base64_encode(mb_convert_encoding($jis_string, 'EUC-JP', 'JIS'))); var_dump(base64_encode(mb_convert_encoding($utf8_string, 'EUC-JP', 'UTF-8'))); echo "\n-- Convert to SJIS --\n"; echo "SJIS encoded string in base64:\n"; var_dump(base64_encode($sjis_string)); echo "Converted Strings:\n"; var_dump(base64_encode(mb_convert_encoding($jis_string, 'SJIS', 'JIS'))); var_dump(base64_encode(mb_convert_encoding($euc_jp_string, 'SJIS', 'EUC-JP'))); var_dump(base64_encode(mb_convert_encoding($utf8_string, 'SJIS', 'UTF-8'))); echo "\n-- Convert to UTF-8 --\n"; echo "UTF-8 encoded string in base64:\n"; var_dump(base64_encode($utf8_string)); echo "Converted Strings:\n"; var_dump(base64_encode(mb_convert_encoding($sjis_string, 'UTF-8', 'SJIS'))); var_dump(base64_encode(mb_convert_encoding($jis_string, 'UTF-8', 'JIS'))); var_dump(base64_encode(mb_convert_encoding($euc_jp_string, 'UTF-8', 'EUC-JP'))); echo "Done"; ?> --EXPECTF-- *** Testing mb_convert_encoding() : basic functionality *** -- Convert to JIS -- JIS encoded string in base64: string(68) "GyRCRnxLXDhsJUYlLSU5JUgkRyQ5ISMbKEIwMTIzNBskQiM1IzYjNyM4IzkhIxsoQg==" Converted Strings: string(68) "GyRCRnxLXDhsJUYlLSU5JUgkRyQ5ISMbKEIwMTIzNBskQiM1IzYjNyM4IzkhIxsoQg==" string(68) "GyRCRnxLXDhsJUYlLSU5JUgkRyQ5ISMbKEIwMTIzNBskQiM1IzYjNyM4IzkhIxsoQg==" string(68) "GyRCRnxLXDhsJUYlLSU5JUgkRyQ5ISMbKEIwMTIzNBskQiM1IzYjNyM4IzkhIxsoQg==" -- Convert to EUC-JP -- EUC-JP encoded string in base64: string(52) "xvzL3LjspcalraW5pcikx6S5oaMwMTIzNKO1o7ajt6O4o7mhow==" Converted Strings: string(52) "xvzL3LjspcalraW5pcikx6S5oaMwMTIzNKO1o7ajt6O4o7mhow==" string(52) "xvzL3LjspcalraW5pcikx6S5oaMwMTIzNKO1o7ajt6O4o7mhow==" string(52) "xvzL3LjspcalraW5pcikx6S5oaMwMTIzNKO1o7ajt6O4o7mhow==" -- Convert to SJIS -- SJIS encoded string in base64: string(52) "k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg==" Converted Strings: string(52) "k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg==" string(52) "k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg==" string(52) "k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg==" -- Convert to UTF-8 -- UTF-8 encoded string in base64: string(72) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=" Converted Strings: string(72) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=" string(72) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=" string(72) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=" Done