{"thread":{"id":"56507","subject":"[PATCH RFC] gitweb: Handle non-ASCII email addresses","startedAt":"2021-09-15T19:32:29Z","lastAt":"2021-09-22T17:42:30Z","messageCount":2,"participants":["Jan-Benedict Glaw"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"436039","messageId":"20210915192647.6fnk7ktwldz7uubf@lug-owl.de","threadId":"56507","inReplyTo":null,"subject":"[PATCH RFC] gitweb: Handle non-ASCII email addresses","fromName":"Jan-Benedict Glaw","fromEmail":"jbglaw@lug-owl.de","sentAt":"2021-09-15T19:26:47Z","receivedAt":"2021-09-15T19:32:29Z","isPatch":true,"sender":{"key":"jbglaw@lug-owl.de","avatar":null},"body":"Hi!\n\nI accidentally had a bad user.email setting (\"jbglaw@ług-owl.de\"\ninstead of \"jbglaw@lug-owl.de\") and this leads to incomplete HTML\nbeing generated by gitweb, along with an error message:\n\nindex.cgi: Wide character in subroutine entry at /usr/share/gitweb/index.cgi line 2208.\n\nThis patch may fix it, but I'm NOT a Perl guy:\n\n--- a/gitweb/gitweb.perl\t2021-09-15 20:23:13.788195846 +0200\n+++ b/gitweb/gitweb.perl\t2021-09-15 20:24:19.911806868 +0200\n@@ -2193,7 +2193,7 @@\n \tmy $size = shift;\n \t$avatar_cache{$email} ||=\n \t\t\"//www.gravatar.com/avatar/\" .\n-\t\t\tmd5_hex($email) . \"?s=\";\n+\t\t\tmd5_hex(utf8::is_utf8($email)? Encode::encode_utf8($email): $email) . \"?s=\";\n \treturn $avatar_cache{$email} . $size;\n }\n\n\nComments?\n\nThanks,\n  Jan-Benedict\n\n-- \n"},{"id":"436742","messageId":"20210922174228.2i2bz2fx3ap45s75@lug-owl.de","threadId":"56507","inReplyTo":"20210915192647.6fnk7ktwldz7uubf@lug-owl.de","subject":"*ping* [PATCH RFC] gitweb: Handle non-ASCII email addresses","fromName":"Jan-Benedict Glaw","fromEmail":"jbglaw@lug-owl.de","sentAt":"2021-09-22T17:42:28Z","receivedAt":"2021-09-22T17:42:30Z","isPatch":true,"sender":{"key":"jbglaw@lug-owl.de","avatar":null},"body":"Hi!\n\nOn Wed, 2021-09-15 21:26:47 +0200, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:\n> I accidentally had a bad user.email setting (\"jbglaw@ług-owl.de\"\n> instead of \"jbglaw@lug-owl.de\") and this leads to incomplete HTML\n> being generated by gitweb, along with an error message:\n> \n> index.cgi: Wide character in subroutine entry at /usr/share/gitweb/index.cgi line 2208.\n> \n> This patch may fix it, but I'm NOT a Perl guy:\n> \n> --- a/gitweb/gitweb.perl\t2021-09-15 20:23:13.788195846 +0200\n> +++ b/gitweb/gitweb.perl\t2021-09-15 20:24:19.911806868 +0200\n> @@ -2193,7 +2193,7 @@\n>  \tmy $size = shift;\n>  \t$avatar_cache{$email} ||=\n>  \t\t\"//www.gravatar.com/avatar/\" .\n> -\t\t\tmd5_hex($email) . \"?s=\";\n> +\t\t\tmd5_hex(utf8::is_utf8($email)? Encode::encode_utf8($email): $email) . \"?s=\";\n>  \treturn $avatar_cache{$email} . $size;\n>  }\n> \n> \n> Comments?\n\nI'd like to get some comment on this, maybe for anybody to merge it?\n\nThanks,\n  Jan-Benedict\n\n-- \n"}]}