Michael Cheung wrote:
> The unicode string which is escaped by NS looks like this,
> %XX%XX%XX%XX...%XX%XX,
> It can be unescaped by CGI module automatically.
>
> But the unicode string which is escaped by IE looks like this,
> %uXXXX%uXXXX...%uXXXX,
> It can't be handled by CGI module.
>
> how to unescape it?
Off the top of my head, something like this might work:
---------
# %u4100%u4200%u4300 => "A\x00B\x00C\x00"
my $str1 = '%u4100%u4200%u4300'; # UTF-16 version of 'ABC'
my $str2 = "A\x00B\x00C\x00";
$str1 =~ s{ %u ([0-9a-f]{4}) } {@{[ pack('H*', $1) ]}}xgi;
print ($str1 eq $str2 ? "Match\n" : "Don't match\n");
--------
But I don't know how you'd use it with CGI (don't do any of it, myself).
--
Ned Konz
currently: Stanwood, WA
email: [EMAIL PROTECTED]
homepage: http://bike-nomad.com, Perl homepage:
http://bike-nomad.com/perl
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]