H
howa
Hello, consider my simple cgi program below:
#=======
#!/usr/bin/perl
use strict;
use CGI;
my $q = new CGI;
my $s = $q->param("s");
print $q->header( -type => "text/html" );
print utf8::valid ($s);
#=======
Then I call, e.g.
http://www.example.com/cgi-bin/test.cgi?s=abc (print 1, ok)
http://www.example.com/cgi-bin/test.cgi?s=$BCfJ8(B (also print 1, but my
paramater s is BIG5 traditional Chinese encoding, not utf8!)
So now I am really confused with the encoding stuff... Can anyone
modify my program above ... so not to print 1 if my $s contains non-
UTF8 characters?
Thanks.
#=======
#!/usr/bin/perl
use strict;
use CGI;
my $q = new CGI;
my $s = $q->param("s");
print $q->header( -type => "text/html" );
print utf8::valid ($s);
#=======
Then I call, e.g.
http://www.example.com/cgi-bin/test.cgi?s=abc (print 1, ok)
http://www.example.com/cgi-bin/test.cgi?s=$BCfJ8(B (also print 1, but my
paramater s is BIG5 traditional Chinese encoding, not utf8!)
So now I am really confused with the encoding stuff... Can anyone
modify my program above ... so not to print 1 if my $s contains non-
UTF8 characters?
Thanks.