Problem with expansion of %{Ldap-UserDn} containing UTF-8 (cf. Bug #411)

Enrik Berkhan enrik#freeradius at planb.de
Mon Aug 27 14:51:59 CEST 2007


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




More information about the Freeradius-Devel mailing list