33 return (preg_match(
'/(?:[^\x00-\x7F])/',$str) !== 1);
49 if ( strlen($str) > 0 ) {
52 return (preg_match(
'/[^\x09\x0A\x0D\x20-\x7E]/',$str) !== 1);
71 '/^([\x00-\x7F]+)|([^\x00-\x7F]+)/S',
73 if ( !isset($matches[2]) ) {
76 $str = substr($str, strlen($matches[0]));
78 $result = ob_get_contents();
96 '/^([^\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+)|([\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+)/S',
98 if ( !isset($matches[2]) ) {
101 $str = substr($str, strlen($matches[0]));
103 $result = ob_get_contents();
122 '/^([\x09\x0A\x0D\x20-\x7E]+)|([^\x09\x0A\x0D\x20-\x7E]+)/S',
124 if ( !isset($matches[2]) ) {
127 $str = substr($str, strlen($matches[0]));
129 $result = ob_get_contents();
159 static $UTF8_LOWER_ACCENTS = NULL;
160 static $UTF8_UPPER_ACCENTS = NULL;
164 if ( is_null($UTF8_LOWER_ACCENTS) ) {
165 $UTF8_LOWER_ACCENTS = array(
166 'à' =>
'a',
'ô' =>
'o',
'ď' =>
'd',
'ḟ' =>
'f',
'ë' =>
'e',
'š' =>
's',
'ơ' =>
'o',
167 'ß' =>
'ss',
'ă' =>
'a',
'ř' =>
'r',
'ț' =>
't',
'ň' =>
'n',
'ā' =>
'a',
'ķ' =>
'k',
168 'ŝ' =>
's',
'ỳ' =>
'y',
'ņ' =>
'n',
'ĺ' =>
'l',
'ħ' =>
'h',
'ṗ' =>
'p',
'ó' =>
'o',
169 'ú' =>
'u',
'ě' =>
'e',
'é' =>
'e',
'ç' =>
'c',
'ẁ' =>
'w',
'ċ' =>
'c',
'õ' =>
'o',
170 'ṡ' =>
's',
'ø' =>
'o',
'ģ' =>
'g',
'ŧ' =>
't',
'ș' =>
's',
'ė' =>
'e',
'ĉ' =>
'c',
171 'ś' =>
's',
'î' =>
'i',
'ű' =>
'u',
'ć' =>
'c',
'ę' =>
'e',
'ŵ' =>
'w',
'ṫ' =>
't',
172 'ū' =>
'u',
'č' =>
'c',
'ö' =>
'oe',
'è' =>
'e',
'ŷ' =>
'y',
'ą' =>
'a',
'ł' =>
'l',
173 'ų' =>
'u',
'ů' =>
'u',
'ş' =>
's',
'ğ' =>
'g',
'ļ' =>
'l',
'ƒ' =>
'f',
'ž' =>
'z',
174 'ẃ' =>
'w',
'ḃ' =>
'b',
'å' =>
'a',
'ì' =>
'i',
'ï' =>
'i',
'ḋ' =>
'd',
'ť' =>
't',
175 'ŗ' =>
'r',
'ä' =>
'ae',
'í' =>
'i',
'ŕ' =>
'r',
'ê' =>
'e',
'ü' =>
'ue',
'ò' =>
'o',
176 'ē' =>
'e',
'ñ' =>
'n',
'ń' =>
'n',
'ĥ' =>
'h',
'ĝ' =>
'g',
'đ' =>
'd',
'ĵ' =>
'j',
177 'ÿ' =>
'y',
'ũ' =>
'u',
'ŭ' =>
'u',
'ư' =>
'u',
'ţ' =>
't',
'ý' =>
'y',
'ő' =>
'o',
178 'â' =>
'a',
'ľ' =>
'l',
'ẅ' =>
'w',
'ż' =>
'z',
'ī' =>
'i',
'ã' =>
'a',
'ġ' =>
'g',
179 'ṁ' =>
'm',
'ō' =>
'o',
'ĩ' =>
'i',
'ù' =>
'u',
'į' =>
'i',
'ź' =>
'z',
'á' =>
'a',
180 'û' =>
'u',
'þ' =>
'th',
'ð' =>
'dh',
'æ' =>
'ae',
'µ' =>
'u',
'ĕ' =>
'e',
185 array_keys($UTF8_LOWER_ACCENTS),
186 array_values($UTF8_LOWER_ACCENTS),
192 if ( is_null($UTF8_UPPER_ACCENTS) ) {
193 $UTF8_UPPER_ACCENTS = array(
194 'À' =>
'A',
'Ô' =>
'O',
'Ď' =>
'D',
'Ḟ' =>
'F',
'Ë' =>
'E',
'Š' =>
'S',
'Ơ' =>
'O',
195 'Ă' =>
'A',
'Ř' =>
'R',
'Ț' =>
'T',
'Ň' =>
'N',
'Ā' =>
'A',
'Ķ' =>
'K',
196 'Ŝ' =>
'S',
'Ỳ' =>
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