# URLDecode

Decodes a URL-encoded string.

## Method Signature

```
URLDecode(string=[any], charset=[string])
```

### Arguments

| Argument  | Type     | Required | Description                                                     | Default |
| --------- | -------- | -------- | --------------------------------------------------------------- | ------- |
| `string`  | `any`    | `true`   | The URL-encoded string to decode.                               |         |
| `charset` | `string` | `false`  | The charset to use when decoding the string. Defaults to UTF-8. | `UTF-8` |

## Examples

### Simple urlDecode() example

Shows how it takes an input of: %21 and returns: !

[Run Example](https://try.boxlang.io/?code=eJwrLcpxSU3OT0nVUFBSNTJUUtC05gIAQ8QFOg%3D%3D)

```java
urlDecode( "%21" );

```

Result: !

### Basic urlDecode() usage

In this example we demonstrate taking a URL encoded message passed on the request context and displaying it decoded.

```java
if( len( rc.MSG ) ) {
	writeOutput( encodeForHTML( urlDecode( rc.MSG ) ) );
}

```

### urlDecode() in obfuscation

In this example we demonstrate url encoding a password before it is encrypted, and then decoding it after it is decrypted.

[Run Example](https://try.boxlang.io/?code=eJwrKE9RsFUoLcpxzUvOT0lNccsvyk0s0VBQUjG0UEmLU4nICUk1MVRS0LTmKi%2FKLEn1Ly0pKAXKFwD1qSkoKVgpgOUKwMak5iUXVRZAZHUUlMyjLPLT9NO9wwsKiyv0y8z8TSs9grwT84oiigssjZ1MKjw9wizNq9IsLAJtlYDqnXz8w908gz30nZ2c9QO8nYNNAxJTUjLz0kGSHq4RBF2RkpoMcQiQQV%2BHQG3G5hZg2LqkgsIWrgqHZqAwAG7SeBo%3D)

```java
pwd = urlEncodedFormat( "$18$f^$XlTe41" );
writeOutput( pwd & " : " );
pwd = encrypt( pwd, "7Z8of/gKWpqsx/v6O5yHRKanrXsp93B4xIHV97zf88Q=", "BLOWFISH/CBC/PKCS5Padding", "HEX" );
writeOutput( pwd & " : " );
decpwd = decrypt( pwd, "7Z8of/gKWpqsx/v6O5yHRKanrXsp93B4xIHV97zf88Q=", "BLOWFISH/CBC/PKCS5Padding", "HEX" );
writeOutput( decpwd & " : " );
decpwd = urlDecode( decpwd );
writeOutput( decpwd );

```

Result: %2418%24f%5E%24XlTe41 : : %2418%24f%5E%24XlTe41 : $18$f^$XlTe41

### urlDecode() usage as a member function

In this example we demonstrate taking a URL encoded message passed on the request context and displaying it decoded using the urlDecode() member function.

```java
if( len( rc.MSG ) ) {
	writeOutput( encodeForHTML( rc.MSG.urlDecode() ) );
}

```

### Additional Examples

[Run Example](https://try.boxlang.io/?code=eJxLzUvOT0lNiS8uKcrMS1ewVVDKKCkpKFY1dlQ1cgOilNQyVSPXnNLk1FQgnV%2BUDhQrAeLy1Jzk%2FFygmEtJPpCAKnABK3czMjAzUbLmSinNLdBQCA3ycUkFWaKhkIpqmaaCpjWXgr6%2BAthKK319oG49sEl6QIv0S%2FShluiW5OuChXWBCvRBhnMBACK4OpY%3D)

```java
encoded_string = "https%3A%2F%2Fdev%2Eboxlang%2Eorg%2Ft%2Fwelcome%2Dto%2Dboxlang%2Ddev%2F2064";
dump( URLDecode( encoded_string ) );

```

## Related

* [ApplicationRestart](/boxlang-language/reference/built-in-functions/system/applicationrestart.md)
* [ApplicationStartTime](/boxlang-language/reference/built-in-functions/system/applicationstarttime.md)
* [ApplicationStop](/boxlang-language/reference/built-in-functions/system/applicationstop.md)
* [BoxAnnounce](/boxlang-language/reference/built-in-functions/system/boxannounce.md)
* [BoxAnnounceAsync](/boxlang-language/reference/built-in-functions/system/boxannounceasync.md)
* [BoxAST](/boxlang-language/reference/built-in-functions/system/boxast.md)
* [BoxModuleReload](/boxlang-language/reference/built-in-functions/system/boxmodulereload.md)
* [BoxRegisterInterceptionPoints](/boxlang-language/reference/built-in-functions/system/boxregisterinterceptionpoints.md)
* [BoxRegisterInterceptor](/boxlang-language/reference/built-in-functions/system/boxregisterinterceptor.md)
* [BoxRegisterRequestInterceptor](/boxlang-language/reference/built-in-functions/system/boxregisterrequestinterceptor.md)
* [BoxUnregisterInterceptor](/boxlang-language/reference/built-in-functions/system/boxunregisterinterceptor.md)
* [BoxUnregisterRequestInterceptor](/boxlang-language/reference/built-in-functions/system/boxunregisterrequestinterceptor.md)
* [CallStackGet](/boxlang-language/reference/built-in-functions/system/callstackget.md)
* [CreateGUID](/boxlang-language/reference/built-in-functions/system/createguid.md)
* [CreateObject](/boxlang-language/reference/built-in-functions/system/createobject.md)
* [CreateUUID](/boxlang-language/reference/built-in-functions/system/createuuid.md)
* [DE](/boxlang-language/reference/built-in-functions/system/de.md)
* [DebugBoxContexts](/boxlang-language/reference/built-in-functions/system/debugboxcontexts.md)
* [Dump](/boxlang-language/reference/built-in-functions/system/dump.md)
* [Duplicate](/boxlang-language/reference/built-in-functions/system/duplicate.md)
* [echo](/boxlang-language/reference/built-in-functions/system/echo.md)
* [EncodeForHTML](/boxlang-language/reference/built-in-functions/system/encodeforhtml.md)
* [GetApplicationMetadata](/boxlang-language/reference/built-in-functions/system/getapplicationmetadata.md)
* [GetBaseTagData](/boxlang-language/reference/built-in-functions/system/getbasetagdata.md)
* [GetBaseTagList](/boxlang-language/reference/built-in-functions/system/getbasetaglist.md)
* [GetBaseTemplatePath](/boxlang-language/reference/built-in-functions/system/getbasetemplatepath.md)
* [GetBoxContext](/boxlang-language/reference/built-in-functions/system/getboxcontext.md)
* [GetBoxRuntime](/boxlang-language/reference/built-in-functions/system/getboxruntime.md)
* [GetBoxVersionInfo](/boxlang-language/reference/built-in-functions/system/getboxversioninfo.md)
* [GetClassMetadata](/boxlang-language/reference/built-in-functions/system/getclassmetadata.md)
* [GetComponentList](/boxlang-language/reference/built-in-functions/system/getcomponentlist.md)
* [GetContextRoot](/boxlang-language/reference/built-in-functions/system/getcontextroot.md)
* [GetCurrentTemplatePath](/boxlang-language/reference/built-in-functions/system/getcurrenttemplatepath.md)
* [GetFileFromPath](/boxlang-language/reference/built-in-functions/system/getfilefrompath.md)
* [GetFunctionCalledName](/boxlang-language/reference/built-in-functions/system/getfunctioncalledname.md)
* [GetFunctionList](/boxlang-language/reference/built-in-functions/system/getfunctionlist.md)
* [GetModuleInfo](/boxlang-language/reference/built-in-functions/system/getmoduleinfo.md)
* [GetModuleList](/boxlang-language/reference/built-in-functions/system/getmodulelist.md)
* [GetRequestClassLoader](/boxlang-language/reference/built-in-functions/system/getrequestclassloader.md)
* [GetSemver](/boxlang-language/reference/built-in-functions/system/getsemver.md)
* [GetSystemSetting](/boxlang-language/reference/built-in-functions/system/getsystemsetting.md)
* [GetTempDirectory](/boxlang-language/reference/built-in-functions/system/gettempdirectory.md)
* [GetTickCount](/boxlang-language/reference/built-in-functions/system/gettickcount.md)
* [htmlEditFormat](/boxlang-language/reference/built-in-functions/system/htmleditformat.md)
* [IIF](/boxlang-language/reference/built-in-functions/system/iif.md)
* [Invoke](/boxlang-language/reference/built-in-functions/system/invoke.md)
* [IsInstanceOf](/boxlang-language/reference/built-in-functions/system/isinstanceof.md)
* [JavaCast](/boxlang-language/reference/built-in-functions/system/javacast.md)
* [ObjectDeserialize](/boxlang-language/reference/built-in-functions/system/objectdeserialize.md)
* [ObjectSerialize](/boxlang-language/reference/built-in-functions/system/objectserialize.md)
* [PagePoolClear](/boxlang-language/reference/built-in-functions/system/pagepoolclear.md)
* [Print](/boxlang-language/reference/built-in-functions/system/print.md)
* [Println](/boxlang-language/reference/built-in-functions/system/println.md)
* [RunThreadInContext](/boxlang-language/reference/built-in-functions/system/runthreadincontext.md)
* [SessionInvalidate](/boxlang-language/reference/built-in-functions/system/sessioninvalidate.md)
* [SessionRotate](/boxlang-language/reference/built-in-functions/system/sessionrotate.md)
* [SessionStartTime](/boxlang-language/reference/built-in-functions/system/sessionstarttime.md)
* [Sleep](/boxlang-language/reference/built-in-functions/system/sleep.md)
* [SystemCacheClear](/boxlang-language/reference/built-in-functions/system/systemcacheclear.md)
* [SystemExecute](/boxlang-language/reference/built-in-functions/system/systemexecute.md)
* [SystemOutput](/boxlang-language/reference/built-in-functions/system/systemoutput.md)
* [Throw](/boxlang-language/reference/built-in-functions/system/throw.md)
* [Trace](/boxlang-language/reference/built-in-functions/system/trace.md)
* [URLEncodedFormat](/boxlang-language/reference/built-in-functions/system/urlencodedformat.md)
* [writeDump](/boxlang-language/reference/built-in-functions/system/writedump.md)
* [WriteLog](/boxlang-language/reference/built-in-functions/system/writelog.md)
* [WriteOutput](/boxlang-language/reference/built-in-functions/system/writeoutput.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/system/urldecode.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
