UnEscape - VBScript
UnEscape
Overview
UnEscape
is a VB Script command used to decode HTML or URL encoded strings, converting them back to their original characters. It is particularly useful for processing web data or user input that may contain special characters or HTML tags.
Syntax
UnEscape(encodedString)
Parameters:
encodedString
: The encoded string to be decoded.
Options/Flags
None
Examples
Simple URL decoding:
Dim encodedURL = "%2Fpath%2Fto%2Fresource"
Dim decodedURL = UnEscape(encodedURL)
Complex HTML decoding:
Dim encodedHTML = "<strong>Decoded text</strong>"
Dim decodedHTML = UnEscape(encodedHTML)
Common Issues
- Incorrect encoding: Ensure the input string is correctly encoded before using
UnEscape
. Attempting to decode an unencoded string will not have any effect. - Double decoding: Avoid decoding the same string multiple times, as it can lead to invalid results.
Integration
UnEscape
can be used in conjunction with other VB Script commands for web data processing. For example, it can be combined with HTMLEncode
for encoding and decoding tasks.
Dim encodedString = HTMLEncode(originalString)
Dim decodedString = UnEscape(encodedString)
Related Commands
HTMLEncode
: Encodes HTML or URL characters.FormatNumber
: Formats numbers according to specified regional settings.