[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: [LDAP] Using foreign charsets / adding entries base64-encoded



Hi!

On Mon, 2 Nov 1998, John Kristian wrote:

> Andreas Kotes wrote:
> > 
> > When I add entries containing umlauts the server checks them in fine, and
> > ldapsearch gets them fine, too. But when I try to look up the records with
> > Netscape I get a "?" for each umlaut, rendering the result unusable.
> 
> I guess your data are stored in the LDAP server in the Latin-1 charset.
> This is not compatible with Netscape software.  Netscape uses UTF-8,
> not Latin-1, in all versions of LDAP.
> 
> Converting between Latin-1 and UTF-8 is simple.  I can send you some
> example code (in C) to do the conversion, if you like.

This would be very nice :)

I'll port it to perl then and contribute it :)

May I call the API the same way after the conversion? Actually, I do it
this way:

[..]
        if (ldap_add_s($ldapc,$dn,\%entry) != LDAP_SUCCESS) {
           ldap_perror($ldapc,"Eintrag $name (ID $data[0])");
         }
[..]

where $ldapc is the connection reference, $dn a scalar in the format
"cn=Oswald Testi, ou=Abteilung 5, o=Firma, c=DE" and %entry a hash with
attributes cn,sn,title,ou,telephonenumber and mail.

And, NO, I don't want to do it via an ldif-file or in another language :]

Encoding the data to UTF-8 should be no problem, but how do I actually
tell the server that he is getting UTF-8 data now?

> > How can I tell the server to use latin1-charset ...
> 
> You can't.  At least, not Netscape Directory Server.

Yeah, just working with it is enough. I use openldap release.

   the Count

--
Andreas Kotes - mailto:count@linux.de - If you need any help, just ask!
    -= "Free speech not only lives, it rocks!" --Oprah Winfrey -=-
-= Commercial use of my email adress NOT allowed. PGP key available. =-