New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
to_json filter could not keep non-ascii characters #68702
Comments
Files identified in the description: If these files are incorrect, please update the |
ansible/lib/ansible/plugins/filter/core.py Lines 76 to 78 in 28f9fbd
This appears to be due to In the meantime however you can probably work around that by doing the following:
|
Thank you so much @mkrizek !! The |
would also require some unit/integration test also, right ? |
) ... as reported in issue ansible#68702 (cherry picked from commit 8c48366)
* Misc typo fixes (#71089) (cherry picked from commit 504ef60) * Add some documentation for the format of meta/runtime.yml (#71035) * Document the format of meta/runtime.yml * Document multiple Ansible versions Clarify difference between deprecation and tombstone fields * add note (cherry picked from commit a9eb8b0) * add note to uninstall older versions of ansible for pip (#71023) * add note to uninstall older versions of ansible for pip * combine with the other PR (cherry picked from commit 72d3d44) * VMware: Inventory scenario guide for hostnames (#71055) Added a scenario guide for ``hostnames`` parameter for vmware_vm_inventory. Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> (cherry picked from commit 0055673) * Document string tests a bit more (#71049) - Explain how `regex` differs from `match` and `search`. - Document `multiline` and `ignorecase`. Signed-off-by: Rick Elrod <rick@elrod.me> (cherry picked from commit 701c638) * docs: Add a note about package requirements for fact gathering (#70796) Fixes: #26148 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> (cherry picked from commit a6725d6) * added note about fakeroot (#71018) see #70895 (cherry picked from commit 11a31e9) * Update documentation of httpapi's handle_httperror method for clarity (#70991) (cherry picked from commit a0523e5) * DOCS: add 2.10 collections roadmap (#70975) * draft of 2.10 collections roadmap * incorporates feedback from felixfontein * gundalow and samccann feedback, fix link Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com> (cherry picked from commit 9879da8) * updates changelog types; some updates for easier translation (#71027) Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 4f4436c) * Document common return values with examples (#71046) * adding return value examples * shift to console code blocks * cleaning up whitespace and shortening invocation example * reordering diff section (cherry picked from commit 864573a) * Update intro_getting_started.rst (#71039) Added two additional learning resources in the See also: section- forgot closing backticks (cherry picked from commit 9850915) * Guide users to use ansible-runner (#71063) Update the docs to guide users to use `ansible-runner` instead of using Python API directly. In many use cases, executing Ansible playbooks are sufficient. In those use cases, `ansible-runner` is easier and much stable to use comparing with Python API, but there is no mention of it. (cherry picked from commit 0c855dc) * Porting guides for ansible-base 2.10 and ansible 2.10 (#70891) * Fix changelog link title. * Rename Ansible 2.10 and 2.11 porting guides to Ansible-base porting guides. * Add stub for automatically generated 2.10 porting guide. * Move things that should not be in the ansible-base porting guide to the ansible porting guide. * Apply changes to base porting guides. * Add remark that ansible-base is mainly for developers. * Ansible Base -> Ansible-base * Fix link in base porting guide. * Add generated porting guide. * Use same header signs as antsibull-changelog's RST builder. * Update generated porting guide. (cherry picked from commit 61b36c6) * Update network platform guides with FQCN (#70699) * fqcn all the docs things! (cherry picked from commit 54bee71) * Document how to upgrade to ansible with pip (#70768) Fixes #70348 (cherry picked from commit 5019335) * document how to migrate between collections (#70243) * document how to migrate between collections * Apply suggestions from code review Co-authored-by: John R Barker <john@johnrbarker.com> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 58145df) * remove github link from plugins (#70951) (cherry picked from commit e28b20d) * Add latest rc from ansible-base (#70974) * Add latest rc from ansible-base (cherry picked from commit d62dffa) * Document to_json will convert to ASCII strings by default (#70954) ... as reported in issue #68702 (cherry picked from commit 8c48366) * Update the porting guide for ansible-2.10.0a8 (#71141) (cherry picked from commit 0a9638c) Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com> Co-authored-by: Sloane Hertel <shertel@redhat.com> Co-authored-by: Rick Elrod <rick@elrod.me> Co-authored-by: Brian Coca <bcoca@users.noreply.github.com> Co-authored-by: Nathaniel Case <ncase@redhat.com> Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com> Co-authored-by: Terciero <terciero@users.noreply.github.com> Co-authored-by: Brendon O'Sullivan <49501251+bjosullivan@users.noreply.github.com> Co-authored-by: EthanHur <ethan0311@gmail.com> Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Baptiste Mille-Mathias <baptiste.millemathias@gmail.com> Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
) ... as reported in issue ansible#68702
Closing as the functionality has been documented in the above PR. |
SUMMARY
to_json/to_nice_json filters could not properly preserve non-ascii characters in variables
ISSUE TYPE
COMPONENT NAME
to_json/to_nice_json filters
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Ubuntu 18.04
STEPS TO REPRODUCE
test-playbook.yml
:test_template.txt.j2
:EXPECTED RESULTS
ACTUAL RESULTS
Is this actual behavior by design? If yes, is it possible to stop it from doing that converting while to keep the raw non-ascii characters, just as what
to_yaml
does?The text was updated successfully, but these errors were encountered: