String comparison with text from different encoding
8 views
Skip to first unread message
kcdenoy
unread,
Nov 29, 2018, 6:40:08 AM11/29/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
Hi all,
I wanted to know if such is possible?
The environment has a host using 'euc-jp' as its encoding.
I'm aware that a result from a command task (e.g. shell: echo "hello world") is automatically converted to 'utf-8' encoding. Is it possible to test strings or similar that is using a different encoding?
Example,
sample.yml
-----
- shell: script.sh
register: res
- debug:
msg: "foobar"
when: res.stdout is search("完了") = True
script.sh <= script is in euc-jp encoding
-----
... # some code here
echo "完了"