Commit cd17ca8e authored by Emmy Vouriot's avatar Emmy Vouriot Committed by Jérome Perrin

str to bytes for testDms WIP

parent 2ddb82bc
...@@ -333,7 +333,9 @@ class TextDocument(CachedConvertableMixin, BaseConvertableFileMixin, TextContent ...@@ -333,7 +333,9 @@ class TextDocument(CachedConvertableMixin, BaseConvertableFileMixin, TextContent
charset = re_match.group('charset') charset = re_match.group('charset')
try: try:
# Use encoding in html document # Use encoding in html document
text_content = text_content.decode(charset).encode('utf-8') text_content = text_content.decode(charset)
if six.PY2:
text_content = text_content.encode('utf-8')
except (UnicodeDecodeError, LookupError): except (UnicodeDecodeError, LookupError):
# Encoding read from document is wrong # Encoding read from document is wrong
text_content, message = guessCharsetAndConvert(self, text_content, message = guessCharsetAndConvert(self,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment