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:
@ -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
|
||||
|
Reference in New Issue
Block a user