mirror of https://github.com/acidanthera/audk.git
BaseTool/ECC: Add UTF-8 support on ECC tool
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19575 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
f3964772d2
commit
975889279d
|
@ -2000,9 +2000,11 @@ class UniParser(object):
|
|||
|
||||
def __read(self):
|
||||
try:
|
||||
self.FileIn = CodecOpenLongFilePath(self.FilePath, Mode = 'rb', Encoding = 'utf_16').read()
|
||||
self.FileIn = CodecOpenLongFilePath(self.FilePath, Mode='rb', Encoding='utf_8').read()
|
||||
except UnicodeError:
|
||||
self.FileIn = CodecOpenLongFilePath(self.FilePath, Mode = 'rb', Encoding = 'utf_16_le').read()
|
||||
self.FileIn = CodecOpenLongFilePath(self.FilePath, Mode='rb', Encoding='utf_16').read()
|
||||
except UnicodeError:
|
||||
self.FileIn = CodecOpenLongFilePath(self.FilePath, Mode='rb', Encoding='utf_16_le').read()
|
||||
except IOError:
|
||||
self.FileIn = ""
|
||||
|
||||
|
|
Loading…
Reference in New Issue