Currently, the ConvertFceToStructurePcd.py tool generate StructurePcd
dsc file with comments including non-ascii character circle R. This
patch changes the non-ascii character circle R to (R) when adding the
comment.

Cc: Bob Feng <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Yuwei Chen <[email protected]>
---
 BaseTools/Scripts/ConvertFceToStructurePcd.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/BaseTools/Scripts/ConvertFceToStructurePcd.py 
b/BaseTools/Scripts/ConvertFceToStructurePcd.py
index 2052db8c4b..d029ed6a28 100644
--- a/BaseTools/Scripts/ConvertFceToStructurePcd.py
+++ b/BaseTools/Scripts/ConvertFceToStructurePcd.py
@@ -285,6 +285,10 @@ class Config(object):
         comment_list = value_re.findall(line) # the string \\... in "Q...." 
line
         comment_list[0] = comment_list[0].replace('//', '')
         comment = comment_list[0].strip()
+        comment_b = bytes(comment, encoding = "utf8")
+        if b"\xae" in comment_b:
+            comment_b = comment_b.replace(b"\xc2\xae", b"(R)") # Change the 
circle "R" character to ascii character
+        comment = str(comment_b, encoding = "utf-8")
         line=value_re.sub('',line) #delete \\... in "Q...." line
         list1=line.split(' ')
         value=self.value_parser(list1)
-- 
2.26.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#74512): https://edk2.groups.io/g/devel/message/74512
Mute This Topic: https://groups.io/mt/82424947/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to