We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 51e8721 commit aafd947Copy full SHA for aafd947
1 file changed
SoftLayer/CLI/core.py
@@ -34,6 +34,22 @@
34
if sys.stdout.isatty():
35
DEFAULT_FORMAT = 'table'
36
37
+# Attempt to set the locale for the user if the default encoding is
38
+# ascii. More information here:
39
+# http://click.pocoo.org/4/python3/#python-3-surrogate-handling
40
+import codecs
41
+import locale
42
+try:
43
+ ENC = codecs.lookup(locale.getpreferredencoding()).name
44
+except Exception:
45
+ ENC = 'ascii'
46
+
47
+if ENC == 'ascii':
48
+ try:
49
+ locale.setlocale(locale.LC_ALL, 'C.UTF-8')
50
+ except Exception:
51
+ pass
52
53
54
class CommandLoader(click.MultiCommand):
55
"""Loads module for click."""
0 commit comments