From 65f217afa82ccbffd98efbf2a9221bbad4c7c527 Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Thu, 31 Jan 2019 11:49:31 +0100 Subject: [PATCH] Fix codec problem on MSW --- strutil.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/strutil.py b/strutil.py index aae6159..33e3f30 100644 --- a/strutil.py +++ b/strutil.py @@ -17,6 +17,10 @@ # String <-> Bytes conversion and output utilities +# Microsoft again not following standards. Sigh. +import codecs +codecs.register(lambda x: codecs.lookup('utf8') if x == 'cp65001' else None) + import sys if sys.hexversion >= 0x3000000: unicode = str