BaseTools/Upt: Add a BOM check for UNI file and fix some help message error

Add a BOM check for UNI file and fix some help message error

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: YangX Li <yangx.li@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17876 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Hess Chen
2015-07-08 05:43:22 +00:00
committed by hchen30
parent c581e5037d
commit fe90f4836a
3 changed files with 29 additions and 4 deletions

View File

@ -721,3 +721,12 @@ def IsValidUserId(UserId):
return False
return True
#
# Check if a UTF16-LE file has a BOM header
#
def CheckUTF16FileHeader(File):
FileIn = open(File, 'rb').read(2)
if FileIn != '\xff\xfe':
return False
return True