perl-unicode

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

2005-09-28 02:54:20
>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.
Isn't this what the first match is doing. And should that be /u[0-9a-fA-F]{4,6}/ to allow for multi-lingual plane stuff?

Martin Hosken