[Catalyst] uri_for() doesn't encode to utf8 first argument

Dmitriy S. Sinyavskiy dreel at bk.ru
Fri May 23 20:48:56 BST 2008


Hello, J..
You write 23 мая 2008 г., 0:18:11:

JS> On Thu, May 22, 2008 at 10:05 AM, Dmitriy S. Sinyavskiy <dreel at bk.ru> wrote:
>>
>> People? what about my patch? I heven't got received any response.
>> I'll be glad to now some news.
>> Thanks.
>>

JS> Your mailserver is rejecting mail.  I suggest fixing your mail server
JS> or viewing the list archives to make sure that you're not missing
JS> things.

JS> Thread:
JS> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/msg02771.html


Test. Must be saved as UTF-8:
=================================
use strict;
use warnings;

use Test::More 'no_plan';
use URI;

use_ok('Catalyst');

my $request = Catalyst::Request->new( {
base => URI->new('http://127.0.0.1/foo')
} );

my $context = Catalyst->new( {
request => $request,
namespace => 'yada',
} );

# test encode first argument with utf-8,
{
$request->base( URI->new('http://127.0.0.1/') );

$context->namespace('');

is( Catalyst::uri_for( $context, '/animal/ёж', 'чёт', { param1 => "щуп" })->as_string,
'http://127.0.0.1/animal/%D1%91%D0%B6/%D1%87%D1%91%D1%82?param1=%C3%91%C2%89%C3%91%C2%83%C3%90%C2%BF',
'URI for undef action with first param as string in unicode'
);
}


-- 
 dreel                    mailto:dreel at bk.ru
 Dmitriy S. Sinyavskiy
 Web-developer            Perl, Catalyst, MSSQL
 FGUE EZAN                Telecommunication, data transfer networks and devices.                      




More information about the Catalyst mailing list