H.C. Lin wrote:

Dear Rich,

Thank you very much for replying. The Aphelion LDAP server I am dealing with
is packaged with PTC Windchill. This is its url:
http://www.btconsulting.com/us/support/dms_documentation/aphelion.htm.

I am programming this application in Java and had tried coverting the
attribute values using their UTF-8 value to construct new Strings with Big5
encoding (new String(sUTF8.getBytes(), "big5"), add attributes back to
AttributeSet then construct a new LDAPEntry with the "converted"
AttributeSet. I then use the LDIFWriter to output the LDAPEntry to file but
the Chinese characters come out garbage.

I am suspecting it's LDIFWriter convering everything again back to UTF-8? I
guess I have to look into LDIFWriter source code to verify this.

It could be. Try using System.out.println.


Please kindly comment.


Yours truely, Ramins Lin


"Rich Megginson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]

H.C. Lin wrote:

Dear Group,

I am green (<1 wk) to LDAP programming. Through resources in the

Internet I

have managed to write a little client that queries Aphelion LDAP server

and

export result to ldif formatted text file.

Off topic, but I've never heard of the Aphelion LDAP server - can you give

me their URL?

However, attribute values with non-English language are exported as

English

alphabet and numeric characters. This is what I really need to solve
urgently.

Having spent a morning searching the Internet, it seems my solution lies

on

implementing the BRE. However, yours truly really cannot crack the

solution

by only reading the sdk doc. I wonder if any of you can show me some

code

that search the LDAPConnection and format the LDAPSearchResult in

specified

encoding scheme (Big5 is what I wanted).

The LDAP standard says that all strings are encoded in UTF8, so you should

be getting back UTF8 data from the LDAP

server (assuming Aphelion does the right thing), which you will then have

to encode in Big5. If you are using Java, the

encoding functions are built-in to the language - check the j2sdk docs for

the String class. If you are using C, the

operating system has an iconv or uconv package which can be used to do the

same thing.

Thank you for reading this post. Any code fragment/suggest will be

deeply

appreciated.


Yours truly,

H.C Lin





_______________________________________________
mozilla-directory mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-directory

Reply via email to