From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web10.9060.1619599496200340678 for ; Wed, 28 Apr 2021 01:44:56 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: yuwei.chen@intel.com) IronPort-SDR: LLRtCJYn2w6t+0LGUMDG0uROaQuokP7h+faCf+zvclPBjJAj66PvgpLPHLMnqhGb2J5gUKexUU EEVGx87M+Pwg== X-IronPort-AV: E=McAfee;i="6200,9189,9967"; a="176805007" X-IronPort-AV: E=Sophos;i="5.82,257,1613462400"; d="scan'208";a="176805007" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2021 01:44:55 -0700 IronPort-SDR: C6QwpVbZ8cop8LY0Z8ZxD6vV4W1pSJBsaDXWoLy1KsZRYRLAVIP9gZ8wo+KrgQLTgdL/afPSho uumY8ezB2Kxg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,257,1613462400"; d="scan'208";a="458076740" Received: from yuweipc.ccr.corp.intel.com ([10.239.158.34]) by fmsmga002.fm.intel.com with ESMTP; 28 Apr 2021 01:44:53 -0700 From: "Yuwei Chen" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao Subject: [PATCH] BaseTools: Change non-ascii character of StructurePcd comment Date: Wed, 28 Apr 2021 16:44:52 +0800 Message-Id: <20210428084452.2043-1-yuwei.chen@intel.com> X-Mailer: git-send-email 2.27.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Liming Gao Signed-off-by: Yuwei Chen --- 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