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
charset = re_match.group('charset')
try:
# 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):
# Encoding read from document is wrong
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