From 97697b00bc9900be512ef76b913057b03856d428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20H=C3=BCwe?= Date: Sun, 12 Jul 2009 18:31:50 +0000 Subject: [PATCH] - use the default enconding if LANG is not set --- osc-wrapper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osc-wrapper.py b/osc-wrapper.py index 7bbe8d18..4f24b147 100755 --- a/osc-wrapper.py +++ b/osc-wrapper.py @@ -8,7 +8,10 @@ import sys, locale # this is a hack to make osc work as expected with utf-8 characters, no matter # how site.py is set... reload(sys) -sys.setdefaultencoding(locale.getdefaultlocale()[1]) +loc = locale.getdefaultlocale()[1] +if not loc: + loc = sys.getdefaultencoding() +sys.setdefaultencoding(loc) del sys.setdefaultencoding from osc import commandline