[Dancer-users] Problem with UTF8 at forward

Takeshi OKURA okura3 at gmail.com
Sun Apr 10 10:24:07 CEST 2011


I like Dancer. and i like to use dancer in my webapp.
But I got a problem with utf8 character. I can't solve the problem myself.

 simple use of utf8 is ok. but Problem got at forward route.

My test code is below. First test is pass. But second test is fail.
Dancer version is 1.3020.
------------------------------------------------------------------
#!/usr/bin/perl
use strict;
use Test::More;
use Dancer;
use Dancer::Test;
use utf8;

get '/direct' => sub {
  my $notes = "\x{3042}\x{3044}\x{3046}\x{3048}\x{304a}";
  return template 'index',{notes => $notes},{layout=>undef};
};

get '/forward' => sub {
  return forward '/direct';
};

response_content_like [GET => '/direct'],
  qr/\x{3042}\x{3044}\x{3046}\x{3048}\x{304a}/,
  "got expected response content for GET /direct";

response_content_like [GET => '/forward'],
  qr/\x{3042}\x{3044}\x{3046}\x{3048}\x{304a}/,
  "got expected response content for GET /forward";

done_testing;
---------------------------------------------------------------------------------

index.tt is '<div id="page"> notes: <% notes %> </div>'.

config.yml is below.

appname: "utf8test"
layout: "main"
charset: "UTF-8"
template: "simple"

Please advice to me.
-- 
Takeshi OKURA


More information about the Dancer-users mailing list