# llUnescapeURL

*LSL function*

```lsl
string string llUnescapeURL(string url);
```

- `string url`: Escaped URL string to decode.

- Returns: `string`
- Energy: 10

Returns a string representing the unescaped/decoded version of url, replacing '%20' with spaces and decoding raw UTF-8 characters.

Returns a [string](https://wiki.secondlife.com/wiki/string) that is an unescaped/unencoded version of **url**, replacing `"%20"` with spaces etc.

```lsl title="How to use" frame="terminal"
string result = llUnescapeURL("");
```

## Caveats

- The [hexadecimal](https://en.wikipedia.org/wiki/Hexadecimal) encoded representation of [UTF-8](https://en.wikipedia.org/wiki/UTF-8) [byte](https://en.wikipedia.org/wiki/Byte) encoding is the only supported means of access to non ASCII7 characters (Unicode characters).
- Decoding of Unicode as `"%u####"` is not supported.
- The `"+"` character is not decoded as a space.

## Examples

<details open>
<summary>Example 1</summary>

```lsl collapse={1-10, 16-24}
string str = "http://wiki.secondlife.com/wiki/LSL Portal";

default
{
    state_entry()
    {
        llOwnerSay("Plain string:\n\t" + str);
        // output: "http://wiki.secondlife.com/wiki/LSL Portal"

        llOwnerSay("Escaped string:\n\t" + llEscapeURL(str));
        // output: "http%3A%2F%2Fwiki%2Esecondlife%2Ecom%2Fwiki%2FLSL%20Portal"

        llOwnerSay("Escaped string unescaped again:\n\t" + llUnescapeURL( llEscapeURL(str) ));
        // output: "http://wiki.secondlife.com/wiki/LSL Portal"

        // because escaping and unescaping are exact opposite
        // and unescaping an escaped string returns the original

        //  For readability's sake it would make more sense to do:
        llOwnerSay("For readability's sake:\n\t" + "http://wiki.secondlife.com/wiki/" + llEscapeURL("LSL Portal"));
        // output: "http://wiki.secondlife.com/wiki/LSL%20Portal"
    }
}
```

</details>

## See also

### Functions

- [llEscapeURL](/functions/llEscapeURL/) — Opposite of `llUnescapeURL`

### Articles

- [UTF-8](https://wiki.secondlife.com/wiki/UTF-8)
- [Base64](https://wiki.secondlife.com/wiki/Category:LSL_Base64)
- [Combined Library: UnicodeIntegerToUTF8](https://wiki.secondlife.com/wiki/Combined_Library#unicode-integer-to-utf8) — Easily convert unicode character codes to string form.

---

*Source: [LlUnescapeURL](https://wiki.secondlife.com/wiki/LlUnescapeURL) on the Second Life Wiki. Content from the Second Life Wiki article LlUnescapeURL (revision 1194332, 2015-01-22), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llUnescapeURL/
