From 1c27ec42363515bda97468dccf57a01c6e66d01e Mon Sep 17 00:00:00 2001 From: "Fan, ZhijuX" Date: Fri, 29 Mar 2019 13:53:40 +0800 Subject: BaseTools:Coding problems caused by special characters BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1670 During BaseTools compiling under Chinese or Japanese language Windows, python exception occurring. UnicodeDecodeError: 'ascii' codec can't decode byte 0xbd in position 3528: ordinal not in range(128) Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan Reviewed-by: Bob Feng --- BaseTools/Source/Python/Common/Misc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BaseTools/Source/Python/Common/Misc.py') diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py index c7daf5417c..47f8e45222 100644 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -1032,7 +1032,7 @@ def ParseFieldValue (Value): p.stderr.close() if err: raise BadExpression("DevicePath: %s" % str(err)) - out = out.decode() + out = out.decode(encoding='utf-8', errors='ignore') Size = len(out.split()) out = ','.join(out.split()) return '{' + out + '}', Size -- cgit v1.2.3