From: Rafael C. <Raf...@li...> - 2001-07-19 13:09:58
|
Hi Hans, I think you should use the Unicode::MapUTF8 module: use Unicode::MapUTF8 qw(from_utf8); ... (now, if you have an entry $entry) ... print from_utf8({-string =3D> $entry->get_value('cn'), -charset =3D> 'ISO-8859-1'}) . "\n"; will print you the cn attribute, translated to ISO-8859-1 Bye, Rafael -----Original Message----- From: Klunder, JAA (Hans) [mailto:J.A...@rf...]=20 Sent: jeudi, 19. juillet 2001 14:45 To: 'per...@li...' Subject: utf8 in LDIF Hi, My question might be off-topic but I'm sure someone has seen this before. I have an LDIF containing base64 data: dn: uid=3Dbruins,dc=3Drabobank, dc=3DNL objectClass: top objectClass: rabomailItem cn:: QnJ1aW5zIFNsb3QsIEogKEp1bGnCunR0ZSk=3D sn: Bruins l: Waalre uid: bruins When I dump this entry after reading with Net::LDAP::LDIF I get: objectclass: top rabomailItem cn: Bruins Slot, J (Juli=C2=BAtte) sn: Bruins l: Waalre uid: bruins I would like to get Juli=EBtte instead of Juli=C2=BAtte . Is there a trick to obtain this latin-1 value instead of the UTF8. I tried: my $cn=3D$entry->get_value('cn'); $cn=3D~ tr/\F0-\x{FF}//UC;=20 print "$cn \n"; Which results in: Bruins Slot, J (Juli=BAtte) I'm using perl 5.6.0 on NT4. Hans Klunder Infra Services Rabobank ICT ZLG 385 Laan van Eikenstein 9 3705 AR Zeist 030-2154036 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D De informatie opgenomen in dit bericht kan vertrouwelijk zijn en=20 is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht=20 onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en=20 de afzender direct te informeren door het bericht te retourneren.=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The information contained in this message may be confidential=20 and is intended to be exclusively for the addressee. Should you=20 receive this message unintentionally, please do not use the contents=20 herein and notify the sender immediately by return e-mail. |