##// END OF EJS Templates
encoding: fix issue with non-standard UTF-8 CTYPE on OS X
Dirkjan Ochtman -
r9574:9e9f63d5 default
parent child Browse files
Show More
@@ -16,7 +16,9 b' try:'
16 16 # On darwin, getpreferredencoding ignores the locale environment and
17 17 # always returns mac-roman. We override this if the environment is
18 18 # not C (has been customized by the user).
19 locale.setlocale(locale.LC_CTYPE, '')
19 lc = locale.setlocale(locale.LC_CTYPE, '')
20 if lc == 'UTF-8':
21 locale.setlocale(locale.LC_CTYPE, 'en_US.UTF-8')
20 22 encoding = locale.getlocale()[1]
21 23 if not encoding:
22 24 encoding = locale.getpreferredencoding() or 'ascii'
General Comments 0
You need to be logged in to leave comments. Login now