Hey Stefan, as you see the the ldap gives me the correct result, till the Dancer module is not loaded. I think it is a Dancer error not an ldap. I created a more simple test case: battila@igornb:~$ dancer -a MyWeb::App ... battila@igornb:~$ cd MyWeb-App battila@igornb:~/MyWeb-App$ vi lib/ChrachterMistake.pm #!/usr/bin/perl -w package ChrachterMistake; use strict; use warnings; sub gimmySomething { return "Bárdi Attila"; } 1; battila@igornb:~/MyWeb-App$ vi lib/MyWeb/App.pm package MyWeb::App; use Dancer ':syntax'; use ChrachterMistake; our $VERSION = '0.1'; get '/' => sub { return ChrachterMistake::gimmySomething(); }; true; battila@igornb:~/MyWeb-App$ perl ./bin/app.pl [9950] core @0.000010> loading Dancer::Handler::Standalone handler in /usr/share/perl5/Dancer/Handler.pm l. 45 [9950] core @0.000181> loading handler 'Dancer::Handler::Standalone' in /usr/share/perl5/Dancer.pm l. 474
Dancer 1.311 server 9950 listening on http://0.0.0.0:3000 == Entering the development dance floor ...
With browser I connect to the http://localhost:3000/ and the result is: Bárdi Attila The Dancer does something with the return value of the function. No ldap in the chain at all. Best regards, Attila On Wed, Dec 18, 2013 at 4:31 PM, Stefan Hornburg (Racke) <racke@linuxia.de>wrote:
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
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users