MCPcopy
hub / github.com/powerline/powerline / get_preferred_output_encoding

Function get_preferred_output_encoding

powerline/lib/encoding.py:39–56  ·  view source on GitHub ↗

Get encoding that should be used for printing strings .. warning:: Falls back to ASCII, so that output is most likely to be displayed correctly.

()

Source from the content-addressed store, hash-verified

37
38
39def get_preferred_output_encoding():
40 '''Get encoding that should be used for printing strings
41
42 .. warning::
43 Falls back to ASCII, so that output is most likely to be displayed
44 correctly.
45 '''
46 if hasattr(locale, 'LC_MESSAGES'):
47 return (
48 locale.getlocale(locale.LC_MESSAGES)[1]
49 or locale.getlocale()[1]
50 or 'ascii'
51 )
52
53 return (
54 locale.getlocale()[1]
55 or 'ascii'
56 )
57
58
59def get_preferred_input_encoding():

Callers 9

powerline.pyFile · 0.90
echoerrFunction · 0.90
run_cmdFunction · 0.90
out_uFunction · 0.90
safe_unicodeFunction · 0.90
create_powerline_loggerFunction · 0.90
__str__Method · 0.90
__new__Method · 0.90
get_unicode_writerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected