Twig Components / Methods / convert_encoding
Note: You are currently reading the documentation for Bolt 5.0. Looking for the documentation for Bolt 5.2 instead?
convert_encoding(to, from)
is a Twig filter to convert a string from one encoding to another. The first argument is the expected output
charset, and the second one is the input charset:
{{ data|convert_encoding('UTF-8', 'iso-2022-jp') }}
Note¶
This filter relies on the iconv extension.
Arguments¶
- to: The output charset
- from: The input charset
Source: Twig
Edit this page on GitHub
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.