From 846161e3d1207d59f62b3a6718221d6f5ba2b94f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 28 May 2020 18:37:08 +0000 Subject: treat $INBOX_DIR/description and gitweb.owner as UTF-8 gitweb does the same with $GIT_DIR/description and gitweb.owner. Allowing UTF-8 description should not cause problems when used in responses for to the NNTP "LIST NEWSGROUPS" request, either, since RFC 3977 section 7.6.6 recommends the description be UTF-8 (but does not require it). Link: https://public-inbox.org/meta/20200528151216.l7vmnmrs4ojw372g@sourcephile.fr/ --- lib/PublicInbox/WwwListing.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/PublicInbox/WwwListing.pm') diff --git a/lib/PublicInbox/WwwListing.pm b/lib/PublicInbox/WwwListing.pm index 38a37dda..a416d24f 100644 --- a/lib/PublicInbox/WwwListing.pm +++ b/lib/PublicInbox/WwwListing.pm @@ -159,6 +159,8 @@ sub manifest_add ($$;$$) { chomp(my $desc = try_cat("$git_dir/description")); $owner = undef if $owner eq ''; $desc = 'Unnamed repository' if $desc eq ''; + utf8::decode($desc); + utf8::decode($owner); # templates/hooks--update.sample and git-multimail in git.git # only match "Unnamed repository", not the full contents of -- cgit v1.2.3-24-ge0c7