From 70e7088b04704d3c31bd57045b234e0b56939239 Mon Sep 17 00:00:00 2001 From: ZyX Date: Wed, 27 Aug 2014 21:30:02 +0400 Subject: [PATCH] Do not replace ascii with UTF-8 in powerline-daemon and python client MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assuming ascii was expected to be used when LANG=C it did not work in any case: in this case preferred encoding is “ANSI_X3.4-1968”. Same for `sys.getfilesystemencoding()`. --- client/powerline.py | 2 -- scripts/powerline-daemon | 2 -- 2 files changed, 4 deletions(-) diff --git a/client/powerline.py b/client/powerline.py index d874b86a..adf99f08 100755 --- a/client/powerline.py +++ b/client/powerline.py @@ -45,8 +45,6 @@ except Exception: os.execvp('powerline-render', args) fenc = sys.getfilesystemencoding() or 'utf-8' -if fenc == 'ascii': - fenc = 'utf-8' tobytes = lambda s: s if isinstance(s, bytes) else s.encode(fenc) diff --git a/scripts/powerline-daemon b/scripts/powerline-daemon index 7e037f9c..26ccdfad 100755 --- a/scripts/powerline-daemon +++ b/scripts/powerline-daemon @@ -143,8 +143,6 @@ def do_write(conn, result): encoding = getpreferredencoding() or 'UTF-8' -if encoding.lower() == 'ascii': - encoding = 'UTF-8' def safe_bytes(o, encoding=encoding):