This verifies that UTF-16 (with BOM) is considered bad data in a .utf8
file.

It also verified that UTF-8 data in a .utf8 file does not generate an
error.

Cc: Yingke D Liu <yingke.d....@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.jus...@intel.com>
---
 BaseTools/Tests/CheckUnicodeSourceFiles.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/BaseTools/Tests/CheckUnicodeSourceFiles.py 
b/BaseTools/Tests/CheckUnicodeSourceFiles.py
index 9646b46..bacbaf6 100644
--- a/BaseTools/Tests/CheckUnicodeSourceFiles.py
+++ b/BaseTools/Tests/CheckUnicodeSourceFiles.py
@@ -89,6 +89,12 @@ class Tests(TestTools.BaseToolsTest):
     def testUtf16InUniFile(self):
         self.CheckFile('.uni', 'utf_16', shouldFail=False)
 
+    def testUtf16InUtf8File(self):
+        self.CheckFile('.utf8', 'utf_16', shouldFail=True)
+
+    def testUtf8InUtf8File(self):
+        self.CheckFile('.utf8', 'utf_8', shouldFail=False)
+
 TheTestSuite = TestTools.MakeTheTestSuite(locals())
 
 if __name__ == '__main__':
-- 
2.1.4


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to