mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-24 11:12:14 +01:00
Fix locale encoding extraction
Using locale.getdefaultlocale() for encoding detection breaks with locales that use modifiers, such as de_DE@euro, or ca_ES@valencia. Use locale.getpreferredencoding() instead, which should do the right thing.
This commit is contained in:
parent
9446307c12
commit
9f35853216
@ -11,9 +11,9 @@ from osc import commandline, babysitter
|
||||
# this is a hack to make osc work as expected with utf-8 characters,
|
||||
# no matter how site.py is set...
|
||||
reload(sys)
|
||||
loc = locale.getdefaultlocale()[1]
|
||||
loc = locale.getpreferredencoding()
|
||||
if not loc:
|
||||
loc = sys.getdefaultencoding()
|
||||
loc = sys.getpreferredencoding()
|
||||
sys.setdefaultencoding(loc)
|
||||
del sys.setdefaultencoding
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user