From: Chris R. <chr...@me...> - 2002-01-14 15:47:32
|
Uwe Jans <ja...@hs...> wrote: > Hi, > > I would like to know how to add a base64 encoded string with perl-ldap? > > In ldif it looks like this: > > cn:: dfvfgwjfhwfj== > > And in Perl-Ldap i tried this: > > $ldap->modify( $dn, add => { cn => 'dfvfgwjfhwfj==' } ); > > but the result look like this in ldif: > > cn: dfvfgwjfhwfj== > > Thats is wrong, isn't it? It isn't what you wanted :-) Just decode the value before sending it to the server. LDAP can transfer binary values in protocol; the only need you have for base-64 is when trying to hold 'difficult' values in text (ie LDIF) files. $ldap->modify( $dn, add => { cn => decode_base64('dfvfgwjfhwfj==') } ); Remember that your (decoded) values must be valid UTF-8 if you are using LDAPv3. Values in ISO-8859-1 are not legal. > > Thanks, for an quick answer. > > Uwe Jans > Cheers, Chris |