directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tino Schwarze <apacheds.li...@tisc.de>
Subject Re: UTF-8 woes
Date Fri, 29 Dec 2006 20:42:30 GMT
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).

Bye,

Tino.

-- 
www.quantenfeuerwerk.de
www.spiritualdesign-chemnitz.de
www.lebensraum11.de

Mime
View raw message