Mantis - Quercus
Viewing Issue Advanced Details
2255 minor always 12-13-07 23:14 09-16-08 18:08
koreth  
nam  
normal  
closed 3.1.4  
fixed  
none    
none 3.2.1  
0002255: iconv() doesn't support target encoding modifier
<?php
print iconv("ISO-8859-1", "UTF-8//IGNORE", "xyz") . "\n";

Vanilla PHP prints "xyz". Quercus throws an exception saying "UTF-8//IGNORE" is an unknown encoding, which is true; iconv() is supposed to accept "//IGNORE" at the end of the target encoding to silently discard characters that can't be represented in the target character set. I assume the //TRANSLIT suffix is not implemented either (but we don't use that one.)

Notes
(0002571)
koreth   
12-13-07 23:17   
Oh, by the way, our actual use case for this:

    return iconv('UTF-8', 'UTF-8//IGNORE', $text);

On vanilla PHP, this will strip out invalid UTF-8 sequences from a string.
(0003448)
nam   
09-16-08 18:08   
php/453[h-l]

IGNORE implemented but TRANSLIT is still not implemented.