/** * @covers Symfony\Polyfill\Iconv\Iconv::iconv */ public function testIconv() { // Native iconv() behavior varies between versions and OS for these two tests // See e.g. https://bugs.php.net/52211 if (defined('HHVM_VERSION') ? HHVM_VERSION_ID >= 30901 : PHP_VERSION_ID >= 50610) { $this->assertFalse(@iconv('UTF-8', 'ISO-8859-1', 'nœud')); $this->assertSame('nud', iconv('UTF-8', 'ISO-8859-1//IGNORE', 'nœud')); } $this->assertSame(utf8_decode('déjà'), iconv('CP1252', 'ISO-8859-1', utf8_decode('déjà'))); $this->assertSame('deja noeud', p::iconv('UTF-8', 'US-ASCII//TRANSLIT', 'déjà nœud')); $this->assertSame('4', iconv('UTF-8', 'UTF-8', 4)); }
function iconv($from, $to, $s) { return p\Iconv::iconv($from, $to, $s); }