[Dancer-users] croaks on utf-8

P Kishor punk.kish at gmail.com
Wed Sep 22 13:28:39 CEST 2010


On Wed, Sep 22, 2010 at 1:23 AM, franck <franck at lumberjaph.net> wrote:
> Hi
>
> On Wed, Sep 22, 2010 at 2:57 AM, P Kishor <punk.kish at gmail.com> wrote:
>>
>> everytime some fancy character is encountered, I get the following
>>
>> in Plack::Middleware::StackTrace::__ANON__ at
>> /usr/local/lib/perl5/5.12.1/Carp.pm line 62
>> body must be bytes and should not contain wide characters (UTF-8 strings)
>>
>>
>> How can I enable Dancer (latest) to cooperate with utf-8?
>>
>
> if you're using template toolkit, check
> http://search.cpan.org/perldoc?Dancer::Cookbook#template_and_unicode
> if you're not using template toolkit, can you tell us what engine you're
> using ?
>


I am using "Tiny," so, I guess, really a subset of TT. I used the
instructions at the link above but that didn't work. When I add the
lines exactly as noted, that is, like so

charset: utf-8
    engines:
      template_toolkit:
        ENCODING: utf8

I get the error

 Error while loading /Users/punkish/Sites/punkish/punkish.pl: YAML
Error: Inconsistent indentation level, referer: http://punkish.local/
[Wed Sep 22 06:22:08 2010] [error] [client 127.0.0.1]    Code:
YAML_PARSE_ERR_INCONSISTENT_INDENTATION


When I change the above to

charset: utf-8
engines:
    template_toolkit:
        ENCODING: utf8

or even just

charset: utf-8

The web site actually loads without an error, but the unicode
character is all messed up. For example, curly quotes show up as

“yes”



>>
>> --
>> Puneet Kishor
>> _______________________________________________
>> Dancer-users mailing list
>> Dancer-users at perldancer.org
>> http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
>
>


More information about the Dancer-users mailing list