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

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




Andreas Kotes wrote:

> 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 :)
>

wait! somebody has already done it!

Please see  the package Unicode-String 2.01 of  Gisle Aas (1997-1998)




> 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?

the capability is built in. As you look at the structure of UTF-8, you will see
that it is just an
expansion of ASCII using a couple of escape characters. Any UTF-8 capable reader
would then recognize the simple ASCII
characters and the "escaped" UTF-8.


>
>
> > > 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. =-

Best regards
Giovanni Baruzzi

begin:vcard 
n:Baruzzi;Giovanni
tel;work:+49-7031-663-1421
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:giovanni.baruzzi@allianz-leben.de
fn:Giovanni Baruzzi
end:vcard