On 12/18/2013 03:03 PM, Attila Bárdi wrote:
Dear dancers,
I have an openldap server and I do some search in there. I wrote a perl module to handle the basic operations in the ldap. So when I search for for example to my displayName, the ldap modul found the following:
battila@igornb:~$ ./test_ldap.pl LdapPerson module is successfully loaded! displayname: Bárdi Attila battila@igornb:~$
test.pl:
*#!/usr/bin/perl -wuse strict;use warnings;use LdapPerson;my $somebody = LdapPerson->new();$somebody = LdapPerson->search('attila.bardi@example.com <attila.bardi@example.com>');print "displayname: " . $somebody->get_displayName() . "\n"*
But with: *use Dancer ':syntax';*
the "*Bárdi Attila*" become "*Bárdi Attila*"
package MyWeb::App; use Dancer ':syntax'; use LdapPerson;
our $VERSION = '0.1';
get '/' => sub { my $somebody = LdapPerson->new(); $somebody = LdapPerson->search('attila.bardi@example.com'); return $somebody->get_displayName(); };
true;
from config.yml:
*# when the charset is set to UTF-8 Dancer will handle for you# all the magic of encoding and decoding. You should not care# about unicode within your app when this setting is set (recommended).charset: "UTF-8"*
Can anyone help me what is the problem and how can I solve it?
LDAP + UTF-8 seems to be tricky, as I learned from writing Dancer::Plugin::LDAP. Maybe you can find some wisdom in its source code? Regards Racke -- LinuXia Systems => http://www.linuxia.de/ Expert Interchange Consulting and System Administration ICDEVGROUP => http://www.icdevgroup.org/ Interchange Development Team