Re: [PATCH] checkpatch: Only encode UTF-8 quoted printable mail headers

From: Joe Perches
Date: Wed Jul 18 2018 - 07:59:09 EST


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);