[Catalyst-commits] r7400 - in Catalyst-Runtime/5.70/trunk: .
lib/Catalyst t
bricas at dev.catalyst.perl.org
bricas at dev.catalyst.perl.org
Thu Jan 17 12:59:09 GMT 2008
Author: bricas
Date: 2008-01-17 12:59:07 +0000 (Thu, 17 Jan 2008)
New Revision: 7400
Modified:
Catalyst-Runtime/5.70/trunk/Changes
Catalyst-Runtime/5.70/trunk/lib/Catalyst/Request.pm
Catalyst-Runtime/5.70/trunk/t/unit_core_uri_for_multibytechar.t
Log:
apply uri_with() patch from Daisuke Murase
Modified: Catalyst-Runtime/5.70/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.70/trunk/Changes 2008-01-16 17:29:13 UTC (rev 7399)
+++ Catalyst-Runtime/5.70/trunk/Changes 2008-01-17 12:59:07 UTC (rev 7400)
@@ -1,7 +1,8 @@
# This file documents the revision history for Perl extension Catalyst.
5.7012 2007-12-16 23:44:00
- - Fix uri_for()'s handling of multibyte chars (Daisuke Murase)
+ - Fix uri_for()'s and uri_with()'s handling of multibyte chars
+ (Daisuke Murase)
- Fix __PACKAGE__->config->{foo} = 'bar' case with subclassing
- Add Catalyst::Stats (Jon Schutz)
- Fixed a bug where ?q=bar=baz is decoded as q=>'bar', not 'bar=baz'.
Modified: Catalyst-Runtime/5.70/trunk/lib/Catalyst/Request.pm
===================================================================
--- Catalyst-Runtime/5.70/trunk/lib/Catalyst/Request.pm 2008-01-16 17:29:13 UTC (rev 7399)
+++ Catalyst-Runtime/5.70/trunk/lib/Catalyst/Request.pm 2008-01-17 12:59:07 UTC (rev 7400)
@@ -539,7 +539,7 @@
next unless defined $value;
for ( ref $value eq 'ARRAY' ? @$value : $value ) {
$_ = "$_";
- utf8::encode( $_ );
+ utf8::encode( $_ ) if utf8::is_utf8($_);
}
};
Modified: Catalyst-Runtime/5.70/trunk/t/unit_core_uri_for_multibytechar.t
===================================================================
--- Catalyst-Runtime/5.70/trunk/t/unit_core_uri_for_multibytechar.t 2008-01-16 17:29:13 UTC (rev 7399)
+++ Catalyst-Runtime/5.70/trunk/t/unit_core_uri_for_multibytechar.t 2008-01-17 12:59:07 UTC (rev 7400)
@@ -7,7 +7,7 @@
use Test::More;
-plan tests => 3;
+plan tests => 5;
use_ok('TestApp');
@@ -15,6 +15,7 @@
my $request = Catalyst::Request->new({
base => URI->new($base),
+ uri => URI->new("$base/"),
});
my $context = TestApp->new({
@@ -30,8 +31,9 @@
# multibyte with utf8 bytes
-is($context->uri_for('/', { name => '村瀬大輔' }), $uri_with_multibyte, 'uri with utf8 bytes query');
+is($context->uri_for('/', { name => '村瀬大輔' }), $uri_with_multibyte, 'uri_for with utf8 bytes query');
+is($context->req->uri_with({ name => '村瀬大輔' }), $uri_with_multibyte, 'uri_with with utf8 bytes query');
-
# multibyte with utf8 string
-is($context->uri_for('/', { name => "\x{6751}\x{702c}\x{5927}\x{8f14}" }), $uri_with_multibyte, 'uri with utf8 string query');
+is($context->uri_for('/', { name => "\x{6751}\x{702c}\x{5927}\x{8f14}" }), $uri_with_multibyte, 'uri_for with utf8 string query');
+is($context->req->uri_with({ name => "\x{6751}\x{702c}\x{5927}\x{8f14}" }), $uri_with_multibyte, 'uri_with with utf8 string query');
More information about the Catalyst-commits
mailing list