Re: [PATCH] Bug #43896 htmlspecialchars returns empty stringoninvalid unicode sequence
| From: | Tomas Kuliavas | Date: | Tue, 29 Jan 2008 05:42:43 +0000 |
| Subject: | Re: [PATCH] Bug #43896 htmlspecialchars returns empty stringoninvalid unicode sequence | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-34995@lists.php.net to get a copy of this message | ||
> That part is completely different. That's at the display level.
> Replacing it in the backend makes no sense to me. Don't use
> utf8_decode. Use iconv() so you know what the heck is going on.
:)
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.
--
Tomas