In .utf8 files, there is the possibility that 32-bit unicode code
points might be used in comments.

While a 32-bit unicode code points should be dissallowed in string
data, it should be allowed in comments.

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 | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/BaseTools/Tests/CheckUnicodeSourceFiles.py 
b/BaseTools/Tests/CheckUnicodeSourceFiles.py
index 3757558..bd76b0d 100644
--- a/BaseTools/Tests/CheckUnicodeSourceFiles.py
+++ b/BaseTools/Tests/CheckUnicodeSourceFiles.py
@@ -112,6 +112,15 @@ class Tests(TestTools.BaseToolsTest):
         self.fail('A unicode code point larger than 0xffff ' +
                   'should raise EdkLogger.FatalError')
 
+    def test32bitUnicodeCharInUtf8Comment(self):
+        data = u'''
+            // Comments can contain 32-bit unicode chars: \U00010300
+            #langdef en-US "English"
+            #string STR_A #language en-US "A"
+        '''
+
+        self.CheckFile('.utf8', 'utf_8', shouldFail=False, string=data)
+
 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