Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame^] | 1 | ``convert_encoding`` |
| 2 | ==================== |
| 3 | |
| 4 | The ``convert_encoding`` filter converts a string from one encoding to |
| 5 | another. The first argument is the expected output charset and the second one |
| 6 | is the input charset: |
| 7 | |
| 8 | .. code-block:: twig |
| 9 | |
| 10 | {{ data|convert_encoding('UTF-8', 'iso-2022-jp') }} |
| 11 | |
| 12 | .. note:: |
| 13 | |
| 14 | This filter relies on the `iconv`_ extension. |
| 15 | |
| 16 | Arguments |
| 17 | --------- |
| 18 | |
| 19 | * ``to``: The output charset |
| 20 | * ``from``: The input charset |
| 21 | |
| 22 | .. _`iconv`: https://secure.php.net/iconv |