in reply to HTTP::Request::Common::POST and UTF-8
#!/usr/bin/perl use strict; use warnings; use LWP; use HTTP::Request::Common; use Encode; use charnames qw(greek); use URI::Escape qw(uri_escape_utf8); ### <-- new line binmode(STDOUT, ":utf8"); my $utf8_data = "<\N{alpha}\N{beta}\N{gamma}\N{delta}>"; print $utf8_data, "\n\n"; print Encode::is_utf8($utf8_data) ? "\$utf8_data marked as UTF-8\n\n" : "\$utf8_data not marked as UTF-8\n\n"; my $request = POST("http://localhost/test", Content => [ data => uri_escape_utf8($utf8_dat +a), ### <-- modified line more_data => "some more data", ] ); my $req_string = $request->as_string(); print Encode::is_utf8($req_string) ? "\$req_string marked as UTF-8\n\n" : "\$req_string not marked as UTF-8\n\n"; print $req_string, "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: HTTP::Request::Common::POST and UTF-8
by scollyer (Sexton) on Sep 28, 2005 at 15:32 UTC | |
|
Re^2: HTTP::Request::Common::POST and UTF-8
by ikegami (Patriarch) on Sep 28, 2005 at 16:57 UTC | |
by scollyer (Sexton) on Sep 28, 2005 at 18:48 UTC |