public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Chen, Christine" <yuwei.chen@intel.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: "Feng, Bob C" <bob.c.feng@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>
Subject: Re: [edk2-devel] [PATCH] BaseTools: Change non-ascii character of StructurePcd comment
Date: Wed, 28 Apr 2021 16:10:09 +0000	[thread overview]
Message-ID: <CO1PR11MB492905D558989235A03C963ED2409@CO1PR11MB4929.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210428084452.2043-1-yuwei.chen@intel.com>

What file type contains the non-ASCII character?

I would prefer to see the source file with non ASCII character be updated instead of building this conversion into the tools.

Mike

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Yuwei Chen
> Sent: Wednesday, April 28, 2021 1:45 AM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>
> Subject: [edk2-devel] [PATCH] BaseTools: Change non-ascii character of StructurePcd comment
> 
> 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 <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Signed-off-by: Yuwei Chen <yuwei.chen@intel.com>
> ---
>  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
> 
> 
> 
> 
> 


  reply	other threads:[~2021-04-28 16:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28  8:44 [PATCH] BaseTools: Change non-ascii character of StructurePcd comment Yuwei Chen
2021-04-28 16:10 ` Michael D Kinney [this message]
2021-04-29  0:25   ` [edk2-devel] " Yuwei Chen
2021-04-29  1:18     ` 回复: " gaoliming
2021-04-29  1:23       ` Yuwei Chen
2021-04-29  2:12         ` Michael D Kinney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CO1PR11MB492905D558989235A03C963ED2409@CO1PR11MB4929.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox