Ejemplo n.º 1
0
 /**
  * @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));
 }
Ejemplo n.º 2
0
 /**
  *
  * @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;
 }