decodeURIComponentIDN

uri_escape

Does exactly the same as URI::Escape::uri_escape() except when utf8-flagged string is fed.

URI::Escape::uri_escape() croak and urge you to uri_escape_utf8() but it is pointless because URI itself has no such things as utf8 flag. The function in this module ALWAYS TREATS the string as byte sequence. That way you can safely use this function without worrying about utf8 flags.

Note on the %uHHHH sequence

With this module the resulting strings never have the utf8 flag on. So if you want to decode it to perl utf8, You have to explicitly decode via Encode. Remember. URIs have always been a byte sequence, not UTF-8 characters.

If the %uHHHH sequence became standard, you could have safely told if a given URI is in Unicode. But more fortunately than unfortunately, the RFC proposal was rejected so you cannot tell which encoding is used just by looking at the URI.