Question: How do I convert a string to URL-encoding?
To convert a string to the URL-encoded form
suitable for transmission as a query string
(or, generally speaking, as part of a URL), use the
This function works as follows:
digits, Latin letters and the characters
+ - * / . _ @
remain unchanged; all other characters in the original string
are replaced by escape-sequences
XX is the ASCII code of the original character.
escape("It's me!") // result: It%27s%20me%21
escape has a more complex behavior.
If the input is a Unicode string, then Unicode characters
will be converted to the Unicode escape-sequences
© 1999-2006, Alexei Kourbatov