You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by st...@apache.org on 2003/10/30 20:41:20 UTC
cvs commit: modperl-2.0/t/modperl post_utf8.t
stas 2003/10/30 11:41:20
Modified: t/response/TestModperl post_utf8.pm
t/modperl post_utf8.t
Log:
don't rely on Accept-Charset on the server side to figure out what the encoding the
POSTed data is in (this is misleading). It should be used only to decide which
encoding to use to respond with
Revision Changes Path
1.2 +1 -2 modperl-2.0/t/response/TestModperl/post_utf8.pm
Index: post_utf8.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/response/TestModperl/post_utf8.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -u -r1.1 -r1.2
--- post_utf8.pm 22 Sep 2003 23:59:14 -0000 1.1
+++ post_utf8.pm 30 Oct 2003 19:41:20 -0000 1.2
@@ -34,8 +34,7 @@
have have_min_perl_version(5.008), have_perl('perlio');
my $received = ModPerl::Test::read_post($r) || "";
- utf8::decode($received)
- if ($r->headers_in->{'Accept-Charset'}||'') =~ /utf-8/i;
+ utf8::decode($received); # assume that we know that it's utf8
my ($received_ascii, $received_utf8) = split /=/, $received;
ok t_cmp($expected_ascii, $received_ascii, "ascii");
1.2 +2 -0 modperl-2.0/t/modperl/post_utf8.t
Index: post_utf8.t
===================================================================
RCS file: /home/cvs/modperl-2.0/t/modperl/post_utf8.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -u -r1.1 -r1.2
--- post_utf8.t 22 Sep 2003 23:59:14 -0000 1.1
+++ post_utf8.t 30 Oct 2003 19:41:20 -0000 1.2
@@ -19,6 +19,8 @@
# we will skip the response any way if perl < 5.008
utf8::encode($data) if $] >= 5.008;
+# Accept-Charset is not really needed, since we don't expect the
+# server side to send anything back but plain ASCII.
print POST_BODY_ASSERT $location, content => $data,
'Accept-Charset' => "ISO-8859-1,UTF-8";