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/ --- t/inbox.t | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 't/inbox.t') diff --git a/t/inbox.t b/t/inbox.t index b59d5dba..08f1724f 100644 --- a/t/inbox.t +++ b/t/inbox.t @@ -22,13 +22,14 @@ is($x->description, '($INBOX_DIR/description missing)', 'default description'); print $fh "https://example.com/inbox\n" or die; close $fh or die; open $fh, '>', "$x->{inboxdir}/description" or die; - print $fh "blah\n" or die; + print $fh "\xc4\x80blah\n" or die; close $fh or die; } is_deeply($x->cloneurl, ['https://example.com/inbox'], 'cloneurls update'); -is($x->description, 'blah', 'description updated'); +ok(utf8::valid($x->description), 'description is utf8::valid'); +is($x->description, "\x{100}blah", 'description updated'); is(unlink(glob("$x->{inboxdir}/*")), 2, 'unlinked cloneurl & description'); is_deeply($x->cloneurl, ['https://example.com/inbox'], 'cloneurls memoized'); -is($x->description, 'blah', 'description memoized'); +is($x->description, "\x{100}blah", 'description memoized'); done_testing(); -- cgit v1.2.3-24-ge0c7