Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Now, lets say my string is equal to "\u1E02oo", that is a capital B with a dot above followed by two o's, then I should get the following url -$href = "http://mywebsite.com?myperl.cgi?param1="+URIComponent(string) +;
#!/usr/bin/perl -w use strict; $| = 1; use CGI qw/:standard :no_xhtml/; use CGI::Carp "fatalsToBrowser"; use HTML::Template; use List::Util qw[ shuffle ]; use URI::Escape; use DBI; use Encode; my $h = new CGI; my $charset = "utf-8"; #print header(-charset=>$charset), print header(), start_html(-title=>"Unicode"); my $compare = "\x{1E02}oo"; my $param1 = param("param1"); //Encode::_utf8_on($param1); if ($compare eq $param1) { print "match"; } print end_html();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Handling params from Javascript's encodeURIComponent function
by Baz (Friar) on Mar 27, 2005 at 20:40 UTC |