[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b7c97031a347fdce25fa0562418908617353df19.camel@perches.com>
Date: Wed, 18 Jul 2018 04:59:04 -0700
From: Joe Perches <joe@...ches.com>
To: Geert Uytterhoeven <geert+renesas@...der.be>,
Andy Whitcroft <apw@...onical.com>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: Stephen Rothwell <sfr@...b.auug.org.au>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] checkpatch: Only encode UTF-8 quoted printable mail
headers
On Wed, 2018-07-18 at 13:35 +0200, Geert Uytterhoeven wrote:
> As PERL uses its own internal character encoding, always calling
> encode("utf8", ...) on the author name may cause corruption, leading to
> an author signoff mismatch.
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -2523,7 +2523,8 @@ sub process {
>
> # Check the patch for a From:
> if (decode("MIME-Header", $line) =~ /^From:\s*(.*)/) {
> - $author = encode("utf8", $1);
> + $author = $1;
> + $author = encode("utf8", $author) if $line =~ /=\?utf-8\?/i;
trivial:
checkpatch uses parentheses around tests so
$author = encode("utf8", $author) if ($line =~ /=\?utf-8\?/i);
Powered by blists - more mailing lists