diff options
Diffstat (limited to 'vendor/twig/twig/doc/filters/convert_encoding.rst')
-rw-r--r-- | vendor/twig/twig/doc/filters/convert_encoding.rst | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/vendor/twig/twig/doc/filters/convert_encoding.rst b/vendor/twig/twig/doc/filters/convert_encoding.rst new file mode 100644 index 00000000..1b0eb60c --- /dev/null +++ b/vendor/twig/twig/doc/filters/convert_encoding.rst | |||
@@ -0,0 +1,28 @@ | |||
1 | ``convert_encoding`` | ||
2 | ==================== | ||
3 | |||
4 | .. versionadded:: 1.4 | ||
5 | The ``convert_encoding`` filter was added in Twig 1.4. | ||
6 | |||
7 | The ``convert_encoding`` filter converts a string from one encoding to | ||
8 | another. The first argument is the expected output charset and the second one | ||
9 | is the input charset: | ||
10 | |||
11 | .. code-block:: jinja | ||
12 | |||
13 | {{ data|convert_encoding('UTF-8', 'iso-2022-jp') }} | ||
14 | |||
15 | .. note:: | ||
16 | |||
17 | This filter relies on the `iconv`_ or `mbstring`_ extension, so one of | ||
18 | them must be installed. In case both are installed, `mbstring`_ is used by | ||
19 | default (Twig before 1.8.1 uses `iconv`_ by default). | ||
20 | |||
21 | Arguments | ||
22 | --------- | ||
23 | |||
24 | * ``from``: The input charset | ||
25 | * ``to``: The output charset | ||
26 | |||
27 | .. _`iconv`: http://php.net/iconv | ||
28 | .. _`mbstring`: http://php.net/mbstring | ||