From 86c28d2432292c6bee149f59175486e5610e4462 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 19 Aug 2020 08:02:33 +0000 Subject: smsg: handle wide characters in raw mail headers There may be messages in the wild with wide characters in headers which aren't non-RFC2047 encoded. Assume UTF-8 so those fields can round trip through over.sqlite3. This doesn't affect docdata.glass in Xapian, but it does affect how over.sqlite3 stores the same deflated info. --- t/psgi_search.t | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 't/psgi_search.t') diff --git a/t/psgi_search.t b/t/psgi_search.t index 2d12ba6a..5d537363 100644 --- a/t/psgi_search.t +++ b/t/psgi_search.t @@ -28,8 +28,10 @@ my $im = $ibx->importer(0); my $digits = '10010260936330'; my $ua = 'Pine.LNX.4.10'; my $mid = "$ua.$digits.2460-100000\@penguin.transmeta.com"; + +# n.b. these headers are not properly RFC2047-encoded my $mime = PublicInbox::Eml->new(< From: Ævar Arnfjörð Bjarmason To: git\@vger.kernel.org @@ -102,6 +104,8 @@ test_psgi(sub { $www->call(@_) }, sub { 'subject-less message linked from "/$INBOX/"'); like($html, qr/\bhref="blank-subject[^>]+>\(no subject\)(GET('/test/?q=tc:git')); like($html, qr/\bhref="no-subject-at-all[^>]+>\(no subject\)