/** * @dataProvider providerTranscode */ public function testTranscode($defaultEncoding, $forceMbString, $from, $to, $iconvTranslit, $string, $expected) { $transcoder = new Transcoder($defaultEncoding, $forceMbString); $this->assertEquals($expected, $transcoder->transcode($string, $from, $to, $iconvTranslit)); }
/** * * @param string $str * @param string $from * @param string $to * @return string */ protected function convertEncoding($str, $from, $to) { return $str !== false ? $this->transcoder->transcode($str, $from, $to, $this->dialect->getTranslit()) : $str; }