Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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.
  • Loading branch information...
commit 9f358532161131fe4a6d31c917b1dd522c14c73e 1 parent 9446307
Jordi Mallach authored nijel committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 osc-wrapper.py
View
4 osc-wrapper.py
@@ -11,9 +11,9 @@
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.