1--TEST-- 2mb_str*() - unknown encoding 3--CREDITS-- 4Jachim Coudenys <jachimcoudenys@gmail.com> 5User Group: PHP-WVL & PHPGent #PHPTestFest 6--EXTENSIONS-- 7mbstring 8--FILE-- 9<?php 10 11try { 12 mb_chr(1, 'UTF-0'); 13} catch (\ValueError $e) { 14 echo $e->getMessage() . \PHP_EOL; 15} 16 17try { 18 mb_convert_case('coudenys', MB_CASE_UPPER, 'UTF-0'); 19} catch (\ValueError $e) { 20 echo $e->getMessage() . \PHP_EOL; 21} 22 23try { 24 mb_convert_encoding('coudenys', 'UTF-8', 'UTF-0'); 25} catch (\ValueError $e) { 26 echo $e->getMessage() . \PHP_EOL; 27} 28 29try { 30 mb_convert_kana('coudenys', 'KV', 'UTF-0'); 31} catch (\ValueError $e) { 32 echo $e->getMessage() . \PHP_EOL; 33} 34 35try { 36 mb_decode_numericentity('coudenys', [], 'UTF-0'); 37} catch (\ValueError $e) { 38 echo $e->getMessage() . \PHP_EOL; 39} 40 41try { 42 mb_ord('coudenys', 'UTF-0'); 43} catch (\ValueError $e) { 44 echo $e->getMessage() . \PHP_EOL; 45} 46 47try { 48 mb_strcut('coudenys', 0, 4, 'UTF-0'); 49} catch (\ValueError $e) { 50 echo $e->getMessage() . \PHP_EOL; 51} 52 53try { 54 mb_strimwidth('coudenys', 0, 4, '', 'UTF-0'); 55} catch (\ValueError $e) { 56 echo $e->getMessage() . \PHP_EOL; 57} 58 59try { 60 mb_stripos('coudenys', 'cou', 0, 'UTF-0'); 61} catch (\ValueError $e) { 62 echo $e->getMessage() . \PHP_EOL; 63} 64 65try { 66 mb_stristr('coudenys', 'cou', false, 'UTF-0'); 67} catch (\ValueError $e) { 68 echo $e->getMessage() . \PHP_EOL; 69} 70 71try { 72 mb_strlen('coudenys', 'UTF-0'); 73} catch (\ValueError $e) { 74 echo $e->getMessage() . \PHP_EOL; 75} 76 77try { 78 mb_strpos('coudenys', 'cou', 0, 'UTF-0'); 79} catch (\ValueError $e) { 80 echo $e->getMessage() . \PHP_EOL; 81} 82 83try { 84 mb_strrchr('coudenys', 'cou', false, 'UTF-0'); 85} catch (\ValueError $e) { 86 echo $e->getMessage() . \PHP_EOL; 87} 88 89try { 90 mb_strrichr('coudenys', 'cou', false, 'UTF-0'); 91} catch (\ValueError $e) { 92 echo $e->getMessage() . \PHP_EOL; 93} 94 95try { 96 mb_strripos('coudenys', 'cou', 0, 'UTF-0'); 97} catch (\ValueError $e) { 98 echo $e->getMessage() . \PHP_EOL; 99} 100 101try { 102 mb_strrpos('coudenys', 'cou', 0, 'UTF-0'); 103} catch (\ValueError $e) { 104 echo $e->getMessage() . \PHP_EOL; 105} 106 107try { 108 mb_strstr('coudenys', 'cou', false, 'UTF-0'); 109} catch (\ValueError $e) { 110 echo $e->getMessage() . \PHP_EOL; 111} 112 113try { 114 mb_strtolower('coudenys', 'UTF-0'); 115} catch (\ValueError $e) { 116 echo $e->getMessage() . \PHP_EOL; 117} 118 119try { 120 mb_strtoupper('coudenys', 'UTF-0'); 121} catch (\ValueError $e) { 122 echo $e->getMessage() . \PHP_EOL; 123} 124 125try { 126 mb_strwidth('coudenys', 'UTF-0'); 127} catch (\ValueError $e) { 128 echo $e->getMessage() . \PHP_EOL; 129} 130 131try { 132 mb_substr('coudenys', 0, null, 'UTF-0'); 133} catch (\ValueError $e) { 134 echo $e->getMessage() . \PHP_EOL; 135} 136 137try { 138 mb_substr_count('coudenys', 'c', 'UTF-0'); 139} catch (\ValueError $e) { 140 echo $e->getMessage() . \PHP_EOL; 141} 142 143?> 144--EXPECT-- 145mb_chr(): Argument #2 ($encoding) must be a valid encoding, "UTF-0" given 146mb_convert_case(): Argument #3 ($encoding) must be a valid encoding, "UTF-0" given 147mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "UTF-0" 148mb_convert_kana(): Argument #3 ($encoding) must be a valid encoding, "UTF-0" given 149mb_decode_numericentity(): Argument #3 ($encoding) must be a valid encoding, "UTF-0" given 150mb_ord(): Argument #2 ($encoding) must be a valid encoding, "UTF-0" given 151mb_strcut(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given 152mb_strimwidth(): Argument #5 ($encoding) must be a valid encoding, "UTF-0" given 153mb_stripos(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given 154mb_stristr(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given 155mb_strlen(): Argument #2 ($encoding) must be a valid encoding, "UTF-0" given 156mb_strpos(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given 157mb_strrchr(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given 158mb_strrichr(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given 159mb_strripos(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given 160mb_strrpos(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given 161mb_strstr(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given 162mb_strtolower(): Argument #2 ($encoding) must be a valid encoding, "UTF-0" given 163mb_strtoupper(): Argument #2 ($encoding) must be a valid encoding, "UTF-0" given 164mb_strwidth(): Argument #2 ($encoding) must be a valid encoding, "UTF-0" given 165mb_substr(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given 166mb_substr_count(): Argument #3 ($encoding) must be a valid encoding, "UTF-0" given 167