mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
base64 filter: Added ability to specify encoding (#39714)
* base64 filter: Added ability to specify encoding * Added unicode chars for further testing * Removed errors to keep previous behaviour in place * Removed surrogate pairs due to issues loading YAML in CI
This commit is contained in:
parent
b5cffe8ced
commit
fc210a4584
4 changed files with 22 additions and 4 deletions
|
@ -185,3 +185,11 @@
|
|||
- flat_two == [1, 2, 3, 4, [5], 6, 7]
|
||||
vars:
|
||||
orig_list: [1, 2, [3, [4, [5]], 6], 7]
|
||||
|
||||
- name: Test base64 filter
|
||||
assert:
|
||||
that:
|
||||
- "'Ansible - くらとみ\n' | b64encode == 'QW5zaWJsZSAtIOOBj+OCieOBqOOBvwo='"
|
||||
- "'QW5zaWJsZSAtIOOBj+OCieOBqOOBvwo=' | b64decode == 'Ansible - くらとみ\n'"
|
||||
- "'Ansible - くらとみ\n' | b64encode(encoding='utf-16-le') == 'QQBuAHMAaQBiAGwAZQAgAC0AIABPMIkwaDB/MAoA'"
|
||||
- "'QQBuAHMAaQBiAGwAZQAgAC0AIABPMIkwaDB/MAoA' | b64decode(encoding='utf-16-le') == 'Ansible - くらとみ\n'"
|
Loading…
Add table
Add a link
Reference in a new issue