Solved

LDAP?

Posted on 2001-06-27
6
472 Views
Last Modified: 2012-08-13
Is anybody knows LDAP ? I have problems with accents in common names....

Mel
0
Comment
Question by:mruel
  • 3
  • 3
6 Comments
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
Which LDAP (protocol) version are you using?
Which perl module for LDAP are you using? (Net::LDAPapi.pm or Netscape LDAPapi.pm).
What are the Problems?
0
 

Author Comment

by:mruel
Comment Utility
I'm using PerLDAP v1.4 and Mozilla::LDAP.

The problem is that names with accents (Like Melanie Ruel) have been saved in LDAP database and when I try to display them on a HTML page, I have something like "M??lanie Ruel", and when I make a ldapsearch on that name, it says that cn=NOT ASCII.

I found that string are UTF-8 encoded, but I don't know how can I decode the string to obtain Melanie instead of M??lanie...
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
I suggest using Net::LDAPapi, it supports UTF8.
I'll check if I find an example, being back soon ...
 
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 51

Accepted Solution

by:
ahoffmann earned 100 total points
Comment Utility
here we go
to get a UTF-encoded sring use:

use Unicode::String qw(latin1 utf8);
$isutf8 = latin1($yourstring)->utf8;
# then use ?isutf8 in your search() call.

Depending on the used LDAP verion (I assume you're using Netscape Directory Server), strings containing non-7bit-ASCII characters were base64 encoded automatically and then stored in the directory. You can use then:

use MIME::Base64;
$isbase64 = encode_base64($yourstring);

and decoding then is like:
$yourstring = utf8($isutf8)->latin1;
$yourstribg = decode_base64($isbase64);
0
 

Author Comment

by:mruel
Comment Utility
Thanks!
I'll try this and come back to tell you if it works.
0
 

Author Comment

by:mruel
Comment Utility
I tried utf8($yourstring)->latin1; And it worked!
It make me save a lot of time, thanks a lot ahoffmann!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now