[dancer-users] character encoding

Иван Бессарабов ivan at bessarabov.ru
Thu Dec 19 13:35:19 GMT 2013


As I know it is better to write:

use open qw(:std :utf8);

It will mark all channels (STDIN, STDOUT, STDERR) to work with utf8 (not
only STDOUT, as you wrote)

On Thursday, December 19, 2013, Attila Bárdi wrote:

> Hey Gunnar,
>
> this is it. I don't remember what did I do yesterday night and why it was
> not working, but now I tested it and it is perfect!
> The solution was what you wrote: just omit setting the *binmode STDOUT,
> 'utf8';* and use the rest. And that is it.
>
> I would like to thank all of you for your help!
>
> Best regards,
> Attila
>
>
> On Thu, Dec 19, 2013 at 9:08 AM, WK <wanradt at gmail.com <javascript:_e({},
> 'cvml', 'wanradt at gmail.com');>> wrote:
>
>> 2013/12/19 Attila Bárdi <attila.bardi at gmail.com <javascript:_e({},
>> 'cvml', 'attila.bardi at gmail.com');>>
>>
>>
>>> But I don't know the solution.
>>>
>>
>> You must deal with decoding in your module, but in your script it should
>> work like this:
>>
>> #!/usr/bin/perl
>> use strict;
>> use warnings;
>> use Encode;
>> binmode STDOUT, 'utf8';
>>
>> my $somebody = LdapPerson->new();
>> $somebody = LdapPerson->search('attila.bardi at example.com<javascript:_e({}, 'cvml', 'attila.bardi at example.com');>
>> ');
>> print "displayname: " . decode('utf-8', $somebody->get_displayName() ) .
>> "\n"
>>
>> In Dancer you must omit setting binmode on STDOUT, because Dancer sets it
>> itself.  Hope it gives  some hints how to deal with such problem.
>>
>> --
>> Wbr,
>> Kõike hääd,
>>
>> Gunnar
>>
>> _______________________________________________
>> dancer-users mailing list
>> dancer-users at dancer.pm <javascript:_e({}, 'cvml',
>> 'dancer-users at dancer.pm');>
>> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20131219/f17768e2/attachment.html>


More information about the dancer-users mailing list