{"thread":{"id":"29031","subject":"[PATCH] gitweb: Output valid utf8 in git_blame_common('data')","startedAt":"2011-11-27T23:52:44Z","lastAt":"2011-11-29T19:46:56Z","messageCount":2,"participants":["Jürgen Kreileder","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"180027","messageId":"CAKD0Uuxq+wLdRy5r_hz9qgjHkDmFHHbeAVkb07HizX9xaGMptw@mail.gmail.com","threadId":"29031","inReplyTo":null,"subject":"[PATCH] gitweb: Output valid utf8 in git_blame_common('data')","fromName":"Jürgen Kreileder","fromEmail":"jk@blackdown.de","sentAt":"2011-11-27T23:52:44Z","receivedAt":"2011-11-27T23:52:44Z","isPatch":true,"sender":{"key":"jk@blackdown.de","avatar":"https://avatars.githubusercontent.com/u/4390544?v=4"},"body":"With javascript-actions enabled gitweb showed broken author names in\nthe tooltips on blame pages.\n\nSigned-off-by: Juergen Kreileder <jk@blackdown.de>\n---\n gitweb/gitweb.perl |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 4f0c3bd..c863afe 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -6107,7 +6107,9 @@ sub git_blame_common {\n \t\t\t-type=>\"text/plain\", -charset => \"utf-8\",\n \t\t\t-status=> \"200 OK\");\n \t\tlocal $| = 1; # output autoflush\n-\t\tprint while <$fd>;\n+\t\twhile (my $line = <$fd>) {\n+\t\t\tprint to_utf8($line);\n+\t\t}\n \t\tclose $fd\n \t\t\tor print \"ERROR $!\\n\";\n\n-- \n1.7.5.4\n"},{"id":"180106","messageId":"m3d3calnip.fsf@localhost.localdomain","threadId":"29031","inReplyTo":"CAKD0Uuxq+wLdRy5r_hz9qgjHkDmFHHbeAVkb07HizX9xaGMptw@mail.gmail.com","subject":"Re: [PATCH] gitweb: Output valid utf8 in git_blame_common('data')","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-11-29T19:46:56Z","receivedAt":"2011-11-29T19:46:56Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jürgen Kreileder <jk@blackdown.de> writes:\n\n> With javascript-actions enabled gitweb showed broken author names in\n> the tooltips on blame pages.\n> \n> Signed-off-by: Juergen Kreileder <jk@blackdown.de>\n> ---\n>  gitweb/gitweb.perl |    4 +++-\n>  1 files changed, 3 insertions(+), 1 deletions(-)\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index 4f0c3bd..c863afe 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -6107,7 +6107,9 @@ sub git_blame_common {\n>  \t\t\t-type=>\"text/plain\", -charset => \"utf-8\",\n>  \t\t\t-status=> \"200 OK\");\n>  \t\tlocal $| = 1; # output autoflush\n> -\t\tprint while <$fd>;\n> +\t\twhile (my $line = <$fd>) {\n> +\t\t\tprint to_utf8($line);\n> +\t\t}\n>  \t\tclose $fd\n>  \t\t\tor print \"ERROR $!\\n\";\n> \n> -- \n\nThanks.  ACK.\n\n\nBTW. all those troubles with not forgetting to call to_utf8() make me\nwonder if we wouldn't be better to forget about supporting\n$fallback_encoding and just put\n\n  use open qw(:encoding(UTF-8) :std); \n\nat the beginning of gitweb, c.f. http://training.perl.com/OSCON2011/index.html\n\n\nOr\n\n  use open qw(:utf8 :std); \n\nthough then we simply discard errors.\n\n-- \nJakub Narębski\n"}]}