|
Newsletters
|
|
|
|
|
WMLScript Reference
WMLScript Reference
WMLScript > URL > escapeString()
escapeString() - The escapeString Function
Usage: escapeString(string)
Description: This function computes a new version of a string value in which special characters specified by [RFC2396] have been replaced by a hexadecimal escape sequence (a two-digit escape sequence of the form %xx must be used). The characters to be escaped are:
- Control Characters: <US-ASCII coded characters 00-1F and 7F>
- Space: <US-ASCII coded character 20 hexadecimal>
- Reserved: ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | ","
- Unwise: "{" | "}" | "|" | "\" | "^" | "[" | "]" | "`"
- Delims: "<" | ">" | "#" | "%" | <">
- Non-US-ASCII: <characters with hex code 8F-FF>
The given string is escaped as such; no URL parsing is performed. Non-US-ASCII characters must be converted using
Example:var a = URL.escapeString("http://w.h.com/dck?x=u007f#crd");
// a = "http%3a%2f%2fw.h.com%2fdck%3fx%3d%7f%23crd"
var b = URL.escapeString("http://w.h.com/dck?x=\u007f#crd");
// b = "http:%3a%2f%2fw.h.com%2fdck%3fx%3d%5cd007f%23crd"
Bookmark this page
|
|