# Unescape URI-Encoded String

> [HTML Version](unescapeuri-encodedstring.htm)

_Updated November 2025_

**xcall CGIUTL, CGIOP\_UNESCAPE, in, out, status**

_Opcode 9_, CGIOP\_UNESCAPE, is a utility function—not limited to CGI programs—used to convert URI-encoded (or percent-encoded) strings to the ASCII equivalent. This type of encoding is primarily used for URLs and URIs (e.g. web addresses) and consists of replacing certain special characters (primarily "\!#\$\&'()\*+,/:;=?@\[\] ") with %xx where xx is the hex value of the original ASCII byte code. Although those are typically the only characters encoded this way in URI's, the function converts all %xx sequences to the equivalent raw ASCII characters. In addition, it will convert any "+" appearing after an initial "?" to a space (since query parameters appended to URLs start with "?" and usually replace any spaces with "+".

**Parameters**

_in  _([String](string.md))  \[in\]  

URI-encoded string to unescape

_out_  ([String](string.md))  \[out\]

receives the output , dynamic string ok

_status  _([Num](num.md))  \[out\]

returns a status code (0 for ok)

**See Also**

•	[fnescape.bsi in SOSLIB:\[907,10\]](https://bitbucket.org/microsabio/soslib/src/master/907010/fnescape.bsi)