From 4f3fcdfda1657e35deb3759173024e3b478a4b15 Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Wed, 12 Nov 2008 23:39:25 +0100 Subject: when passing a broken utf-8 string, ignore characters. fixes #55. --- lib/python/Components/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/python/Components/config.py') diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index 4ddcabec..4d57bbb9 100755 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -782,12 +782,12 @@ class ConfigText(ConfigElement, NumericalTextInput): def getValue(self): return self.text.encode("utf-8") - + def setValue(self, val): try: self.text = val.decode("utf-8") except UnicodeDecodeError: - self.text = val + self.text = val.decode("utf-8", "ignore") print "Broken UTF8!" value = property(getValue, setValue) -- cgit v1.2.3