uri_escape - Escape unsafe characters
uri_unescape - Unescape escaped characters
use URI::Escape; $safe = uri_escape("10% is enough\n"); $str = uri_unescape($safe);
This module provide functions to escape and unescape URIs strings. Some characters are regarded as "unsafe" and must be escaped in accordance with RFC 1738. Escaped characters are represented by a triplet consisting of the character "%" followed by two hexadecimal digits.
The uri_escape() function takes an optional second argument that overrides the set of characters that are to be escaped.