Chris@0: convertEncoding = $encodingUpper; Chris@0: } Chris@0: Chris@0: if ($convertEncoding !== null) { Chris@0: if ($encodingUpper !== strtoupper($convertEncoding)) { Chris@0: throw new Exception\InvalidArgumentException( Chris@0: 'Wrapper doesn\'t support to convert between character encodings' Chris@0: ); Chris@0: } Chris@0: Chris@0: $this->convertEncoding = $encodingUpper; Chris@0: } else { Chris@0: $this->convertEncoding = null; Chris@0: } Chris@0: $this->encoding = $encodingUpper; Chris@0: Chris@0: return $this; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Returns the length of the given string Chris@0: * Chris@0: * @param string $str Chris@0: * @return int|false Chris@0: */ Chris@0: public function strlen($str) Chris@0: { Chris@0: return strlen($str); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Returns the portion of string specified by the start and length parameters Chris@0: * Chris@0: * @param string $str Chris@0: * @param int $offset Chris@0: * @param int|null $length Chris@0: * @return string|false Chris@0: */ Chris@0: public function substr($str, $offset = 0, $length = null) Chris@0: { Chris@0: return substr($str, $offset, $length); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Find the position of the first occurrence of a substring in a string Chris@0: * Chris@0: * @param string $haystack Chris@0: * @param string $needle Chris@0: * @param int $offset Chris@0: * @return int|false Chris@0: */ Chris@0: public function strpos($haystack, $needle, $offset = 0) Chris@0: { Chris@0: return strpos($haystack, $needle, $offset); Chris@0: } Chris@0: }