diff options
author | Chen, Christine <Yuwei.Chen@intel.com> | 2021-06-28 16:46:44 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-07-12 02:18:45 +0000 |
commit | 3de3c24755bdee191429c0a72aed5110e9a0b2f9 (patch) | |
tree | ecc8ca6bf9cd356828d9d932faa726274585390b /BaseTools/Scripts | |
parent | ad1009ec626bea7a718d595f98f0ad49a16c6e5b (diff) | |
download | edk2-3de3c24755bdee191429c0a72aed5110e9a0b2f9.tar.gz edk2-3de3c24755bdee191429c0a72aed5110e9a0b2f9.tar.bz2 edk2-3de3c24755bdee191429c0a72aed5110e9a0b2f9.zip |
BaseTools: Remove non-ascii character of StructurePcd comment
Currently, the ConvertFceToStructurePcd.py tool generate
StructurePcd dsc file with comments from UNI file including
non-ascii character. Following DSC spec, there should not have
non-ascii character in DSC file. This patch removes the non-ascii
character when adding the comment and changes the circle R to (R).
Signed-off-by: Yuwei Chen <yuwei.chen@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Scripts')
-rw-r--r-- | BaseTools/Scripts/ConvertFceToStructurePcd.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/BaseTools/Scripts/ConvertFceToStructurePcd.py b/BaseTools/Scripts/ConvertFceToStructurePcd.py index 2052db8c4b..2baabf2dd5 100644 --- a/BaseTools/Scripts/ConvertFceToStructurePcd.py +++ b/BaseTools/Scripts/ConvertFceToStructurePcd.py @@ -284,7 +284,15 @@ class Config(object): line=x.split('\n')[0]
comment_list = value_re.findall(line) # the string \\... in "Q...." line
comment_list[0] = comment_list[0].replace('//', '')
- comment = comment_list[0].strip()
+ comment_ori = comment_list[0].strip()
+ comment = ""
+ for each in comment_ori:
+ if each != " " and "\x21" > each or each > "\x7E":
+ if bytes(each, 'utf-16') == b'\xff\xfe\xae\x00':
+ each = '(R)'
+ else:
+ each = ""
+ comment += each
line=value_re.sub('',line) #delete \\... in "Q...." line
list1=line.split(' ')
value=self.value_parser(list1)
|