matrix-docker-ansible-deploy
matrix-docker-ansible-deploy copied to clipboard
`to_json` breaks emoji in Hookshot displayname
https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/0c6959de8b0e3a3013a3ea7c376ca969ee4a1165/roles/custom/matrix-bridge-hookshot/templates/config.yml.j2#L104
Setting an emoji such as matrix_hookshot_bot_displayname: 🌉 Hookshot becomes displayname: "\ud83c\udf09 Hookshot" in the config.yml which then fails
fatal: [matrix.example.org]: FAILED! =>
msg: |-
An unhandled exception occurred while templating '{{ matrix_hookshot_configuration_yaml | from_yaml | combine(matrix_hookshot_configuration_extension, recursive=True) }}'. Error was a <class 'yaml.scanner.ScannerError'>, original message: while parsing a quoted scalar
in "<unicode string>", line 71, column 16
found invalid Unicode character escape code
in "<unicode string>", line 71, column 19
It works without to_json.
Maybe we need to use to_json(ensure_ascii=False)? https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html#filter-to-json-and-unicode-support
seems to work. this might apply to all similar settings as well.