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