Lines Matching refs:s
24 public static function utf8_encode($s) argument
26 $s .= $s;
27 $len = \strlen($s);
31 case $s[$i] < "\x80": $s[$j] = $s[$i]; break;
32 case $s[$i] < "\xC0": $s[$j] = "\xC2"; $s[++$j] = $s[$i]; break;
33 default: $s[$j] = "\xC3"; $s[++$j] = \chr(\ord($s[$i]) - 64); break;
37 return substr($s, 0, $j);
40 public static function utf8_decode($s) argument
42 $s = (string) $s;
43 $len = \strlen($s);
46 switch ($s[$i] & "\xF0") {
49 $c = (\ord($s[$i] & "\x1F") << 6) | \ord($s[++$i] & "\x3F");
50 $s[$j] = $c < 256 ? \chr($c) : '?';
58 $s[$j] = '?';
63 $s[$j] = $s[$i];
67 return substr($s, 0, $j);
176 $s = \chr($code);
178 $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F);
180 $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F);
182 …$s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(…
186 $s = mb_convert_encoding($s, $encoding, 'UTF-8');
189 return $s;
192 public static function mb_ord($s, $encoding = null) argument
195 $s = mb_convert_encoding($s, 'UTF-8');
197 $s = mb_convert_encoding($s, 'UTF-8', $encoding);
200 if (1 === \strlen($s)) {
201 return \ord($s);
204 $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0;
206 … return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80;
209 return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80;
212 return (($code - 0xC0) << 6) + $s[2] - 0x80;