Unicode fixes #915

wants to merge 3 commits into from

2 participants


These patches allow execution of commands containing characters outside ASCII, as well as receiving command results containing such characters.

They assume the local encoding is UTF-8.

gnosek added some commits Aug 20, 2012
@gnosek gnosek Handle UTF-8 in templates
This is required to run commands containing non-ASCII characters, e.g.:

ansible localhost -m shell -a 'echo ą'
@gnosek gnosek Enable UTF-8 commands via the raw module
Paramiko does not allow Unicode strings as parameters, so encode
the command to UTF-8.

Test case:

ansible localhost -m raw -a 'echo ą'

(also tested on local and ssh transports without problems)
@gnosek gnosek Fix UTF-8 output when using executable inventory files
The 'hostname' variable is then unicode, which breaks interpolating
stdout etc. contents into the output strings (they are bytes and cannot
be converted to Unicode using ASCII codec)

merged in, thanks! I had fixed templates previously but was pretty sure I didn't hit everything.

@mpdehaan mpdehaan closed this Aug 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment