/* Try iconv with transliteration. */
if (Horde_Util::extensionExists('iconv')) {
- /* We need to tack an extra character temporarily because of a bug
- * in iconv() if the last character is not a 7 bit ASCII
- * character. */
unset($php_errormsg);
ini_set('track_errors', 1);
- $out = @iconv($from, $to . '//TRANSLIT', $input . 'x');
+ $out = @iconv($from, $to . '//TRANSLIT', $input);
$errmsg = isset($php_errormsg);
ini_restore('track_errors');
if (!$errmsg) {
- return self::substr($out, 0, -1, $to);
+ return $out;
}
}
$this->assertEquals('foo', Horde_String::common('foobar', 'fooxyx'));
$this->assertEquals('foo', Horde_String::common('foo', 'foobar'));
}
+
+ public function testBug9528()
+ {
+ $this->assertEquals(
+ "<html>",
+ Horde_String::convertCharset("<html>", 'UTF-8', 'Windows-1258')
+ );
+ }
+
}