Lines Matching refs:encoding

141     public static function mb_decode_numericentity($s, $convmap, $encoding = null)  argument
153 if (null !== $encoding && !\is_scalar($encoding)) {
164 $encoding = self::getEncoding($encoding);
166 if ('UTF-8' === $encoding) {
167 $encoding = null;
172 $s = iconv($encoding, 'UTF-8//IGNORE', $s);
194 if (null === $encoding) {
198 return iconv('UTF-8', $encoding.'//IGNORE', $s);
201 public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) argument
213 if (null !== $encoding && !\is_scalar($encoding)) {
230 $encoding = self::getEncoding($encoding);
232 if ('UTF-8' === $encoding) {
233 $encoding = null;
238 $s = iconv($encoding, 'UTF-8//IGNORE', $s);
264 if (null === $encoding) {
268 return iconv('UTF-8', $encoding.'//IGNORE', $result);
271 public static function mb_convert_case($s, $mode, $encoding = null) argument
278 $encoding = self::getEncoding($encoding);
280 if ('UTF-8' === $encoding) {
281 $encoding = null;
286 $s = iconv($encoding, 'UTF-8//IGNORE', $s);
346 if (null === $encoding) {
350 return iconv('UTF-8', $encoding.'//IGNORE', $s);
353 public static function mb_internal_encoding($encoding = null) argument
355 if (null === $encoding) {
359 $normalizedEncoding = self::getEncoding($encoding);
371 …ew \ValueError(sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding));
400 public static function mb_encoding_aliases($encoding) argument
402 switch (strtoupper($encoding)) {
411 public static function mb_check_encoding($var = null, $encoding = null) argument
419 if (null === $encoding) {
423 $encoding = self::$internalEncoding;
427 …return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var);
431 if (!self::mb_check_encoding($key, $encoding)) {
434 if (!self::mb_check_encoding($value, $encoding)) {
508 public static function mb_strlen($s, $encoding = null) argument
510 $encoding = self::getEncoding($encoding);
511 if ('CP850' === $encoding || 'ASCII' === $encoding) {
515 return @iconv_strlen($s, $encoding);
518 public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) argument
520 $encoding = self::getEncoding($encoding);
521 if ('CP850' === $encoding || 'ASCII' === $encoding) {
536 return iconv_strpos($haystack, $needle, $offset, $encoding);
539 public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) argument
541 $encoding = self::getEncoding($encoding);
542 if ('CP850' === $encoding || 'ASCII' === $encoding) {
551 $haystack = self::mb_substr($haystack, 0, $offset, $encoding);
555 $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding);
560 ? iconv_strrpos($haystack, $needle, $encoding)
561 : self::mb_strlen($haystack, $encoding);
566 public static function mb_str_split($string, $split_length = 1, $encoding = null) argument
584 if (null === $encoding) {
585 $encoding = mb_internal_encoding();
588 if ('UTF-8' === $encoding = self::getEncoding($encoding)) {
600 $length = mb_strlen($string, $encoding);
603 $result[] = mb_substr($string, $i, $split_length, $encoding);
609 public static function mb_strtolower($s, $encoding = null) argument
611 return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding);
614 public static function mb_strtoupper($s, $encoding = null) argument
616 return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding);
637 public static function mb_substr($s, $start, $length = null, $encoding = null) argument
639 $encoding = self::getEncoding($encoding);
640 if ('CP850' === $encoding || 'ASCII' === $encoding) {
645 $start = iconv_strlen($s, $encoding) + $start;
654 $length = iconv_strlen($s, $encoding) + $length - $start;
660 return (string) iconv_substr($s, $start, $length, $encoding);
663 public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) argument
666 self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding),
667 self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding),
670 return self::mb_strpos($haystack, $needle, $offset, $encoding);
673 public static function mb_stristr($haystack, $needle, $part = false, $encoding = null) argument
675 $pos = self::mb_stripos($haystack, $needle, 0, $encoding);
677 return self::getSubpart($pos, $part, $haystack, $encoding);
680 public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null) argument
682 $encoding = self::getEncoding($encoding);
683 if ('CP850' === $encoding || 'ASCII' === $encoding) {
686 $needle = self::mb_substr($needle, 0, 1, $encoding);
687 $pos = iconv_strrpos($haystack, $needle, $encoding);
690 return self::getSubpart($pos, $part, $haystack, $encoding);
693 public static function mb_strrichr($haystack, $needle, $part = false, $encoding = null) argument
695 $needle = self::mb_substr($needle, 0, 1, $encoding);
696 $pos = self::mb_strripos($haystack, $needle, $encoding);
698 return self::getSubpart($pos, $part, $haystack, $encoding);
701 public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) argument
703 $haystack = self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding);
704 $needle = self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding);
709 return self::mb_strrpos($haystack, $needle, $offset, $encoding);
712 public static function mb_strstr($haystack, $needle, $part = false, $encoding = null) argument
759 public static function mb_http_output($encoding = null) argument
761 return null !== $encoding ? 'pass' === $encoding : 'pass';
764 public static function mb_strwidth($s, $encoding = null) argument
766 $encoding = self::getEncoding($encoding);
768 if ('UTF-8' !== $encoding) {
769 $s = iconv($encoding, 'UTF-8//IGNORE', $s);
777 public static function mb_substr_count($haystack, $needle, $encoding = null) argument
787 public static function mb_chr($code, $encoding = null) argument
799 if ('UTF-8' !== $encoding = self::getEncoding($encoding)) {
800 $s = mb_convert_encoding($s, $encoding, 'UTF-8');
806 public static function mb_ord($s, $encoding = null) argument
808 if ('UTF-8' !== $encoding = self::getEncoding($encoding)) {
809 $s = mb_convert_encoding($s, 'UTF-8', $encoding);
830 …$length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, string $encoding = null): string argument
836 if (null === $encoding) {
837 $encoding = self::mb_internal_encoding();
841 $validEncoding = @self::mb_check_encoding('', $encoding);
843 …(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding));
848 …(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding));
851 if (self::mb_strlen($pad_string, $encoding) <= 0) {
855 $paddingRequired = $length - self::mb_strlen($string, $encoding);
863 …self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding).$string;
865 …$string.self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding);
870 …leftPaddingLength, $encoding).$string.self::mb_substr(str_repeat($pad_string, $rightPaddingLength)…
874 private static function getSubpart($pos, $part, $haystack, $encoding) argument
880 return self::mb_substr($haystack, 0, $pos, $encoding);
883 return self::mb_substr($haystack, $pos, null, $encoding);
925 private static function getEncoding($encoding) argument
927 if (null === $encoding) {
931 if ('UTF-8' === $encoding) {
935 $encoding = strtoupper($encoding);
937 if ('8BIT' === $encoding || 'BINARY' === $encoding) {
941 if ('UTF8' === $encoding) {
945 return $encoding;