<div dir="ltr">Hey,<div><br></div><div><div>battila@igornb:~/Dancer/MyWebApp/lib$ ./<a href="http://test_ldap.pl">test_ldap.pl</a> </div><div>LdapPerson module is successfully loaded!</div><div>displayname: Bárdi Attila</div>
<div>unix perlio</div><div>battila@igornb:~/Dancer/MyWebApp/lib$ </div></div><div><br></div><div>Hmml, there is no utf8. </div><div><br></div><div>I found the following while I search for the solution and before I read you e-mail:</div>
<div>the ldap does not set the utf8 flag (I don't know why) so I tried to ask it to set the flag.</div><div>I used the <i>raw => qr/(?i:^jpegPhoto|;binary)/ </i>option at the bind, but it just confused the thing, because it converted to utf8.</div>
<div>I also tried to use several utf8, unicode modules without success.</div><div><br></div><div>But I don't know the solution.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Dec 18, 2013 at 10:00 PM, WK <span dir="ltr"><<a href="mailto:wanradt@gmail.com" target="_blank">wanradt@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2013/12/18 Attila Bárdi <span dir="ltr"><<a href="mailto:attila.bardi@gmail.com" target="_blank">attila.bardi@gmail.com</a>></span><br>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div><div><div class="im"><div><div>I have an openldap server and I do some search in there.<br></div><br></div></div><div class="im">So when I search for for example to my displayName, the ldap modul found the following:<br>


<br>battila@igornb:~$  ./<a href="http://test_ldap.pl" target="_blank">test_ldap.pl</a> <br>LdapPerson module is successfully loaded!<br>displayname: Bárdi Attila<br>battila@igornb:~$ <br><br><br></div></div><div class="im">
<div><a href="http://test.pl" target="_blank">test.pl</a>:<br>

<i>#!/usr/bin/perl -w<br>use strict;<br>use warnings;<br>use LdapPerson;<br></i></div></div></div></div></blockquote><div><br></div><div>Don't you get any "wide character" warnings? </div></div><div class="gmail_extra">

<br></div>As far as I understand you have problem with decoding your input from LDAP. </div><div class="gmail_extra"><br></div><div class="gmail_extra">When you use your module without Dancer you seem not decode your input and Perl treats your input by bytes and on print it outputs these same bytes. So, when you have UTF-8 enabled environment those bytes are shown as right characters even when they are not meant as such.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">Now, using Dancer you tell explicitly to use UTF-8 and because your input is not decoded properly (not marked as UTF-8) Dancer will treat this string as Latin1 and decodes bytes after ASCII-set again to its inner Unicode and on printing again to UTF-8. This causes such output as you have.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">You could add to your <a href="http://test.pl" target="_blank">test.pl</a> one line to test your output filters:</div><div class="gmail_extra"><br></div><div class="gmail_extra">

print join( ' ', PerlIO::get_layers('STDOUT') ), "\n";<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">If the last filter is not "utf8", my conclusion should be right.</div>
<span class="HOEnZb"><font color="#888888">
<div class="gmail_extra"><br><div>-- <br></div><div class="gmail_extra">Wbr,</div><div class="gmail_extra">Kőike hääd,<br></div><br>Gunnar</div></font></span></div>
<br>_______________________________________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
<br></blockquote></div><br></div>