Module: check_mk
Branch: master
Commit: e41b1c479cb4010729d47805c20f1b3ed38e93d2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e41b1c479cb401…
Author: Roland Halbig <rh(a)mathias-kettner.de>
Date: Wed Dec 7 14:58:16 2016 +0100
htmllib:Fixed utf-8 bug.
---
web/htdocs/htmllib.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 8cd91f7..4e33594 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -160,7 +160,10 @@ class HTML(unicode, Escaper):
def __new__(self, value = ''):
- return unicode.__new__(self, value)
+ try:
+ return unicode.__new__(self, value)
+ except UnicodeDecodeError as e:
+ return unicode.__new__(self, value.decode('utf-8'))
def __repr__(self):