如何在还原Cookie中的中文字?

我在一个Perl程序中写入一个Cookie,其中有中文字,如何在网页中还原?我现在总是乱码!
---------------------------------------------------------------

在 Perl 中通常类似:
print header(-cookie=>[$cookie]);
改为:
my $tcookie = header(-cookie=>[$cookie]);
$tcookie =~ s/%([A-Fa-f0-9]{2})/pack("c",hex($1))/ge;
print $tcookie;

Published At
Categories with Web编程
Tagged with
comments powered by Disqus