From 83c63e85def2038ecdb21bfdb6fb4f4f26306124 Mon Sep 17 00:00:00 2001
From: Nikos Kouremenos <kourem@gmail.com>
Date: Sun, 28 Aug 2005 10:45:29 +0000
Subject: [PATCH] fix parsing config file

---
 src/common/optparser.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/common/optparser.py b/src/common/optparser.py
index f507db5ecd..20c40ce749 100644
--- a/src/common/optparser.py
+++ b/src/common/optparser.py
@@ -17,6 +17,7 @@
 ##
 
 import os
+import locale
 from common import gajim
 from common import i18n
 _ = i18n._
@@ -52,7 +53,10 @@ class OptionsParser:
 			return
 
 		for line in fd.readlines():
-			line = line.decode('utf-8')
+			try:
+				line = line.decode('utf-8')
+			except UnicodeDecodeError:
+				line = line.decode(locale.getpreferredencoding())
 			self.read_line(line)
 
 		fd.close()
-- 
GitLab