diff --git a/src/Mod/Start/StartPage/StartPage.py b/src/Mod/Start/StartPage/StartPage.py index 302ddaf250..90e7c98168 100644 --- a/src/Mod/Start/StartPage/StartPage.py +++ b/src/Mod/Start/StartPage/StartPage.py @@ -472,10 +472,14 @@ def handle(): Start.iconbank = iconbank Start.tempfolder = tempfolder - # encode if necessary + # make sure we are always returning unicode + # HTML should be a str-object and therefor: + # - for py2 HTML is a bytes object and has to be decoded to unicode + # - for py3 HTML is already a unicode object and the next 2 lines can be removed + # once py2-support is removed. - if not isinstance(HTML, bytes): - HTML = HTML.encode("utf8") + if isinstance(HTML, bytes): + HTML = HTML.decode("utf8") return HTML