URL decoding throwing errors
24 May 2016 01:30 PM
|
|
Summary This article describes the errors thrown when decoding URLs and how to detect invalid characters to avoid the errors Details When decoding certain URLs using xdmp:url-decode(), it is possible that certain characters will cause one of two errors to be thrown.
The specification for the Uniform Resource Identifier (URI): Generic Syntax can be found here: https://tools.ietf.org/html/rfc3986. In particular, the following section explains why certain characters are invalid: "Non-ASCII characters must first be encoded according to UTF-8 [STD63], and then each octet of the corresponding UTF-8 sequence must be percent-encoded to be represented as URI characters." The code below can be used to detect invalid characters. Make sure to remove any invalid characters prior to URL decoding.
| |
|