# EXSLT - str:decode-uri - Implementer Page

Version: 2 Status: new User Page: index.html XML Definition: str.decode-uri.xml Function Package: str.decode-uri.zip

#### Function Syntax

    string str:decode-uri(string, string)

The `str:decode-uri` function returns its first argument string with URI escape sequences, as described in [RFC 2396] section 2.4.1, converted back to the characters they represent.

The optional second argument to the function supplies a character encoding name, which can be given case-insensitively, and should be listed in [Charsets]. If the named encoding is supported by the function implementation, then it is used as the basis for interpreting the octet sequences obtained when unescaping non-ASCII characters. UTF-8 is the default encoding, and is the only encoding required to be supported by this function. If the encoding is given as an empty string or is not supported, then an empty string is returned. If the encoding is supported, but an escaped octet sequence in the string cannot be decoded to a character in that encoding, then the sequence is ignored.

Examples:

`str:decode-uri('http://www.example.com/my%20r%E9sum%C3%A9.html')`
returns
`http://www.example.com/my résumé.html`

`str:decode-uri('http://www.example.com/my%20r%E9sum%E9.html','iso-8859-1')`
returns
`http://www.example.com/my résumé.html` if the implementation supports iso-8859-1.

An implementation of this extension function in the EXSLT str namespace must conform to the behaviour described in this document.

## Implementations

Built-in support for `str:decode-uri` is available in the following XSLT processors:

Processor | Processor Version | Implemented Version
--- | --- | ---
4XSLT, from 4Suite. | 0.12.0a3 | 1

The following implementations of `str:decode-uri` are available:

Language | Implemented Version | Creator | Date | Download
--- | --- | --- | --- | ---
Javascript | 1 | Chris Bayes | 2001-06-26 | str.decode-uri.js
Msxsl | 1 | Chris Bayes | 2001-06-26 | str.decode-uri.msxsl.xsl

## Change History

Previous Version: str.decode-uri.1.html

Version | Modified | By | Details
--- | --- | --- | ---
2 | 2002-12-02 | Mike Brown | Updated the function syntax to include information on [RFC 2396] and character encoding.

http://www.exslt.org/str/functions/decode-uri/str.decode-uri.html last modified 2002-12-02