From: Chris R. <chr...@me...> - 2002-01-15 16:12:13
|
Felix Aertz <ae...@rz...> wrote: > Hi >=20 > my problem is: I will add a String into LDAP with perl-ldap. > The string contains non-ascii codes. >=20 > My first step is to encode the string from latin1 to utf8 than > to base64. Next, I tried to add the encoded string. Ther is the > problem. The string should end up as binary data in LDAP > example: sn: Wei=DF -> sn:: V2Vpw58=3D >=20 > At next I tried this way: >=20 > $enc_text=3D"Wei=DF"; > $log_username=3D"XMan" ; > $ldap_base=3D"ou=3Dstaff, dc=3Dhs-bremen, dc=3Dde"; > $u=3DUnicode::String::latin1($enc_text); > $Result =3D $ldap->modify("uid=3D$log_username,$ldap_base", > replace =3D> { 'sn' =3D> encode_base64($u->utf8) } ); >=20 > It dosn't work, too!!! > The output is "sn: V2Vpw58=3D" not "sn:: V2Vpw58=3D" >=20 > What can I do that? There is no need to base-64 encode the value, just pass in the UTF-8 = string. Cheers, Chris |