> iconv() will stop on conversion error and return partial string or empty > string. It will require even more complex code than 5.2.5 > htmlspecialchars() does. With htmlspecialchars you check for empty string > before and after the call. With iconv you check for php errors during > iconv call. the current impl of iconv() wrap in php is a pain in the @$$, i can only get truncated string if there's some invalid char, or rely on glibc "//IGNORE" flag. "string".encode() in python is much better that u can with 'ignore', 'replace', 'xmlcharrefreplace', 'backslashreplace' as the 2nd param of encode() i agree that ignoring the invalid char in "all case" is not good, but truncating in all case isn't either. there're some case acceptable like user post -> server accept it, ignoring invalid chars -> and user have chance to review his text later.
too bad that the conversation implicit like __set/__get that you can't add one more optional paramter. hope there's some nice way to get this problem done. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php