Btw, more or less off-topic, CGI::Util can unescape unicode with the uXXXX convention but does not follow this convension when doing escaping -; i.e. I changed its encoding routine from
$toencode=~s/([^a-zA-Z0-9_.~-])/uc sprintf("%%%02x",ord($1))/eg; to