Re: CGI::Util unescape() after escape() loses utf8 flag

[email protected] (David Graff)
Newsgroups perl.unicode
Message-ID <[email protected]>
David Graff said:

> Looking at the source for CGI::Util...

I should have mentioned that I was quoting from version 1.3 of CGI::Util,
but the relevant points are still valid in the current version (1.5).

On closer inspection of the source, I see that the "unescape" function can
accept a string like /u([0-9a-fA-F]{4})/ as well as /%([0-9a-fA-F]{2})/,
and it will correctly set the utf8 flag when decoding a string that matches
the former form; but the "escape" function can only produce the latter
form.

Perhaps it might be time to add an optional argument to "escape", that 
would allow for creating the "uHHHH" form?  It would be simple enough to 
do, I'd expect.

	Dave Graff
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.