2007/5/11, Dr.Ruud <[EMAIL PROTECTED]>:
"Jen mlists" schreef:
> I'm faint I MUST take the time to work with double-character
> handling though I'm not familiar with it.
> What's the function in perl which is equal to Java's this call:
> java.net.URLDecoder.decode(s, "UTF-8")
Hello all,
I need to translate this string,
Perl%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%28%EF%BF%BD%EF%BF%BD%EF%BF%BD%C4%B0%EF%BF%BD%29.pdf
This was a string appeared in our web logs.
I tried this way,
use strict;
use Encode;
use URI::Escape;
my $str =
'Perl%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%28%EF%BF%BD%EF%BF%BD%EF%BF%BD%C4%B0%EF%BF%BD%29.pdf';
my $tr;
$tr = encode("gb2312",decode("utf8",$str)); # It was 'gb2312' format
originally.
$tr = uri_unescape($tr);
print $tr;
__END__
But it couldn't work.Please help,thank you.
--Jen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/