summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/UPT/Library/ParserValidate.py
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTools/Source/Python/UPT/Library/ParserValidate.py')
-rw-r--r--BaseTools/Source/Python/UPT/Library/ParserValidate.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/UPT/Library/ParserValidate.py b/BaseTools/Source/Python/UPT/Library/ParserValidate.py
index bfb4bc749f..e973227898 100644
--- a/BaseTools/Source/Python/UPT/Library/ParserValidate.py
+++ b/BaseTools/Source/Python/UPT/Library/ParserValidate.py
@@ -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