Re: LDAPConnection search result in different encoding

2004-12-10 Thread Rich Megginson
H.C. Lin wrote:
Thank you very much for your keen support, Rich : ),
After knowing LDAP talks in UTF-8 we configure the receiving end(Microsoft
MIIS 2003) to use UTF-8 and that solves the Character encoding problem.
However, My previous impletementation to obtain changed(add/modify) data
does not comply to stand and the MIIS server could not understand the delta
data.
What I have done for the added/modified data is to query the LDAP server for
everything and filter the entries with a timestamp. Then I export those
entries with createTimestamp/modifyTimestamp later than my timestamp to an
LDIF file using LDIF Writer. The result contains entries without
changetype attribute. Do you know the way to query LDAP server so the
result will contain changed data?
There is no standard way.  It depends on which LDAP server you are using.  Netscape/Sun DS support a changelog which is 
generally used to do what you want to do.  The changelog is not on by default, it has to be turned on and configured. 
In Netscape/Sun DS 5.0 and later, this is implemented as a plugin called the Retro Changelog.


Have a good weekend.
Ramins Lin
Rich Megginson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
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


Re: LDAPConnection search result in different encoding

2004-12-07 Thread H.C. Lin
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.

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