27 Aug
2007
27 Aug
'07
8:51 a.m.
Hi, Alan DeKok wrote:
No. iconv() returns error on invalid UTF-8 sequence. What we want is to escape invalid UTF-8 sequences.
The idea would be: try iconv("UTF-8" -> "UTF-8"), escape if that fails. Is there anonther good portable or even standard way of doing this? Clear disadvantage of iconv() is the non-thread-awareness of the state storage, so it should either be re-allocated on every usage (not cheap, I suppose) or be allocated in thread-local-storage somehow. Any better suggestions? Enrik