fabric/fabric — pull request #810 by kkzk (2013-01-07 06:17:53+00:00)
Title: Encoding support.

Add `env.host_encoding` to specify remote host's encoding.

In case of remote host's `LANG` is not `C` , in particular non-ascii characterset, error message of remote command will not fuman-readable. Tested on local-WIndows(cp932) and remote-Linux(Japanese).

```python
# -*- coding: cp932 -*-

from fabric.api import run, get, env, local, put, hosts, puts
env.user="root"

@hosts("target")
def unicode_test():
# display localized error message
r = run("cat /root/org/limits.conf", warn_only=True) # no such file
# print r
puts(r)

# pass non-ascii character to command line
r = run(u"ls -l | grep デスクトップ ", warn_only=True)
# print r
puts(r)

# and retrieve file contents (non ascii)
r = run(u"cat デスクトップ/テキスト.txt ", warn_only=True)
# print r
puts(r)
# if you want raw(not converted) data, use get().

# again.
r = run(u"cat デスクトップ/テキスト.txt | grep 管理表", warn_only=True)
# print r
puts(r)

```