directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@gmail.com>
Subject Re: UTF-8 woes
Date Fri, 29 Dec 2006 21:18:03 GMT
Tino Schwarze a écrit :

>On Fri, Dec 29, 2006 at 08:37:07PM +0100, Emmanuel Lecharny wrote:
>
>  
>
>>There is a _big_ difference, because your java file might have been 
>>saved using a ISO-8859-1 encoding. new RDN( "ä" ) just use the default 
>>encoding of your computer to store the file, and inside this file you 
>>    
>>
>
>I was not talking about characters from a Java source, the data came
>directly from a database. The test case is pretty simple:
>
>    byte[] _bytes = new byte[] { (byte)0xc3, (byte)0xa4, (byte)0xc3, (byte)0xb6, (byte)0xc3,
(byte)0xbc };
>      
>    String _s = new String (_bytes, "utf-8");
>    
>    // this should print äöü
>    System.out.println (_s);
>    LdapDN _dnTest = new LdapDN();
>    _dnTest.add ("cn=Uml"+_s);
>    System.out.println (_dnTest.toString());
>  
>-> this will get mixed up instantly by the RdnParser - it converts every
>non-ASCII byte to \xy encoding (I'm not sure who's doing the "\" to "%5C"
>conversion later).
>  
>
Great, and thanks for the test case. I gonna inject it into the junit 
tests, and give you a feedback in a few moment. If it's a bug in RDN, 
then let's fix it ! :)

Emmanuel


Mime
View raw message