Do not replace ascii with UTF-8 in powerline-daemon and python client
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()`.
This commit is contained in:
parent
dc1d50bc8f
commit
70e7088b04
|
@ -45,8 +45,6 @@ except Exception:
|
||||||
os.execvp('powerline-render', args)
|
os.execvp('powerline-render', args)
|
||||||
|
|
||||||
fenc = sys.getfilesystemencoding() or 'utf-8'
|
fenc = sys.getfilesystemencoding() or 'utf-8'
|
||||||
if fenc == 'ascii':
|
|
||||||
fenc = 'utf-8'
|
|
||||||
|
|
||||||
tobytes = lambda s: s if isinstance(s, bytes) else s.encode(fenc)
|
tobytes = lambda s: s if isinstance(s, bytes) else s.encode(fenc)
|
||||||
|
|
||||||
|
|
|
@ -143,8 +143,6 @@ def do_write(conn, result):
|
||||||
|
|
||||||
|
|
||||||
encoding = getpreferredencoding() or 'UTF-8'
|
encoding = getpreferredencoding() or 'UTF-8'
|
||||||
if encoding.lower() == 'ascii':
|
|
||||||
encoding = 'UTF-8'
|
|
||||||
|
|
||||||
|
|
||||||
def safe_bytes(o, encoding=encoding):
|
def safe_bytes(o, encoding=encoding):
|
||||||
|
|
Loading…
Reference in New Issue