Re: [Net::LDAP] Using UTF-8 in DN

Peter Karman <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.ldap
Message-ID <[email protected]>
Dmitry Katsubo wrote on 05/13/2009 07:51 AM:

> I also suffer from a limitation, that "email" attribute may only contain
> ASCII chars. For example, I cannot set:
> 
> mail: Rudolf Bünger <[email protected]>
> 
> If storing UTF8 in this attribute is not supported, maybe one can give
> an advice, how to convert it to ASCII? I used:
> 
> 'mail' => encode('ascii', $email);
> 
> but it replaces the non-valid chars with "?":
> 

I use Search::Tools::Transliterate for this.

use Search::Tools::Transliterate;
use Search::Tools::UTF8;

my $ascifier = Search::Tools::Transliterate->new( ebit => 0 );
my $ascii    = $ascifier->convert( to_utf8( $my_email ) );

-- 
Peter Karman  .  [email protected]  .  http://peknet.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.