Re: [Dancer-users] Problem with UTF8 at forward
Sorry. I sent mail to person not to dancer-mailing list. 2011/4/12 Takeshi OKURA <okura3@gmail.com>:
2011/4/11 David Precious <davidp@preshweb.co.uk>:
On Sunday 10 April 2011 16:04:57 Alberto Simoes wrote:
Yes, it is not. The fix: https://github.com/sukria/Dancer/pull/446 is not yet merged.
I've just reviewed and approved this; I'll try to find a moment this afternoon to test and merge it in, and verify that it causes Takeshi's test to pass.
I tried to merge the above fix in my dancer. But I could not done that.
case one. I simply copy the 3 module in https://github.com/ambs/Dancer/commit/07aaead406135aa406fec07654e87dfd03c3d4... to my environment.
case two. git clone https://github.com/ambs/Dancer.git and install it.
Both case my test faild. I might have misunderstood how to merge the fix code.
So I will wait until the release of dancer which merged issue 433.
Thank you every one. Dancer is a my favorite WAF.
-- Takeshi OKURA
Hello
git clone https://github.com/ambs/Dancer.git
and then git checkout PR/expose_433 And then do the installation dance :)
2011/4/13 ambs <ambs+dancer@perl-hackers.net>:
git checkout PR/expose_433
Thank you ambs. I did it. And when seeing in a web browser, /direct and /forward looks same. I am Happy. But my previous test still fail and little more changed test case below is pass. ------------------------------------------------------------------------------------ use strict; use Test::More; use Dancer; use Dancer::Test; use Encode qw/encode_utf8/; use utf8; my $utf8_str = "\x{3042}\x{3044}\x{3046}\x{3048}\x{304a}"; my $utf8_byte = encode_utf8( $utf8_str ); get '/direct' => sub { my $notes = $utf8_str; return template 'index',{notes => $notes},{layout=>undef}; }; get '/forward' => sub { return forward '/direct'; }; response_content_like [GET => '/direct'], qr/\Q$utf8_str\E/, "got expected response content for GET /direct"; response_content_like [GET => '/forward'], qr/\Q$utf8_byte\E/, "got expected response content for GET /forward"; done_testing; ------------------------------------------------------------------------------------ it is seems to be 'forward' returns utf8 encoded byte stream, -- Takeshi OKURA
On 13/04/2011 15:10, Takeshi OKURA wrote:
it is seems to be 'forward' returns utf8 encoded byte stream,
Yes, it does. At the moment response is encoded the first time to the encoding specified in the configuration file the first time it is built. Then, it just passes along without further encoding. This can be changed to, pass along unmodified and encode at the end, if that matters. Cheers
participants (3)
-
Alberto Simoes -
ambs -
Takeshi OKURA