Document to_json will convert to ASCII strings by default (#70954)

... as reported in issue #68702
pull/71024/head
Baptiste Mille-Mathias 4 years ago committed by GitHub
parent e28b20d729
commit 8c48366f1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -240,6 +240,24 @@ for example::
- set_fact:
myvar: "{{ result.stdout | from_json }}"
Filter `to_json` and Unicode support
------------------------------------
By default `to_json` and `to_nice_json` will convert data received to ASCII, so::
{{ 'München'| to_json }}
will return::
'M\u00fcnchen'
To keep Unicode characters, pass the parameter `ensure_ascii=False` to the filter::
{{ 'München'| to_json(ensure_ascii=False) }}
'München'
.. versionadded:: 2.7
To parse multi-document YAML strings, the ``from_yaml_all`` filter is provided.

Loading…
Cancel
Save