X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FTests%2FCheckUnicodeSourceFiles.py;h=6ae62f180a840090141d4fdf23aafe0e3a7e99c8;hp=2eeb0f551d7e1d5fa6d3094e11a6b70ecb339c59;hb=aaa4c651bf5ba5fce14e9fe8c2c12687886f745d;hpb=8fb5a0cae32261d8650c9d6bb645c10872b8426f diff --git a/BaseTools/Tests/CheckUnicodeSourceFiles.py b/BaseTools/Tests/CheckUnicodeSourceFiles.py index 2eeb0f551d..6ae62f180a 100644 --- a/BaseTools/Tests/CheckUnicodeSourceFiles.py +++ b/BaseTools/Tests/CheckUnicodeSourceFiles.py @@ -114,6 +114,17 @@ class Tests(TestTools.BaseToolsTest): self.CheckFile(encoding=None, shouldPass=False, string=data) + def testValidUtf8File(self): + self.CheckFile(encoding='utf_8', shouldPass=True) + + def testValidUtf8FileWithBom(self): + # + # Same test as testValidUtf8File, but add the UTF-8 BOM + # + data = codecs.BOM_UTF8 + codecs.encode(self.SampleData, 'utf_8') + + self.CheckFile(encoding=None, shouldPass=True, string=data) + def test32bitUnicodeCharInUtf8File(self): data = u''' #langdef en-US "English"