2023-02-06 14:42:31 +01:00
# unescape
2021-12-03 11:59:22 +01:00
`unescape` is used to decode `entity` , `html` and `htmlall` . It counters
2023-02-06 14:42:31 +01:00
the effects of the [escape modifier ](language-modifier-escape.md ) for the
2021-12-03 11:59:22 +01:00
given types.
2023-02-06 14:42:31 +01:00
## Basic usage
```smarty
{$myVar|unescape}
```
2021-12-03 11:59:22 +01:00
2023-02-06 14:42:31 +01:00
## Parameters
2021-12-03 11:59:22 +01:00
2023-02-06 14:42:31 +01:00
| Parameter Position | Type | Required | Possible Values | Default | Description |
|--------------------|--------|----------|----------------------------------------------------------------------------------------------------------------|---------|------------------------------------------------------------------------------------------------------------------------------|
| 1 | string | No | `html` , `htmlall` , `entity` , | `html` | This is the escape format to use. |
| 2 | string | No | `ISO-8859-1` , `UTF-8` , and any character set supported by [`htmlentities()` ](https://www.php.net/htmlentities ) | `UTF-8` | The character set encoding passed to html\_entity\_decode() or htmlspecialchars\_decode() or mb\_convert\_encoding() et. al. |
2021-12-03 11:59:22 +01:00
2023-02-06 14:42:31 +01:00
## Examples
2021-12-03 11:59:22 +01:00
2023-02-06 14:42:31 +01:00
```php
< ?php
2021-12-03 11:59:22 +01:00
2023-02-06 14:42:31 +01:00
$smarty->assign('articleTitle',
"Germans use " Ü mlauts" and pay in € uro"
);
```
2021-12-03 11:59:22 +01:00
These are example `unescape` template lines followed by the output
2023-02-06 14:42:31 +01:00
```smarty
{$articleTitle}
Germans use " Ü mlauts" and pay in € uro
2021-12-03 11:59:22 +01:00
2023-02-06 14:42:31 +01:00
{$articleTitle|unescape:"html"}
Germans use "Ü mlauts" and pay in € uro
2021-12-03 11:59:22 +01:00
2023-02-06 14:42:31 +01:00
{$articleTitle|unescape:"htmlall"}
Germans use "Ümlauts" and pay in €uro
```
2021-12-03 11:59:22 +01:00
2023-02-06 14:42:31 +01:00
See also [escaping smarty parsing ](../language-basic-syntax/language-escaping.md ), [escape
modifier](language-modifier-escape.md).