<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><div>I have an openldap server and I do some search in there.<br></div><br></div>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><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></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">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>
<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></div>