From: Eric Wong <e@80x24.org>
To: "Thomas Weißschuh" <thomas@t-8ch.de>
Cc: meta@public-inbox.org
Subject: Re: [PATCH 3/3] mbox: Specify encoding for raw message display
Date: Mon, 25 Oct 2021 00:08:24 +0000 [thread overview]
Message-ID: <20211025000824.GA20307@dcvr> (raw)
In-Reply-To: <20211024214337.161779-3-thomas@t-8ch.de>
Thomas Weißschuh <thomas@t-8ch.de> wrote:
> +++ b/lib/PublicInbox/Mbox.pm
> @@ -58,10 +58,10 @@ sub res_hdr ($$) {
> my @hdr = ('Content-Type');
> if ($ctx->{ibx}->{obfuscate}) {
> # obfuscation is stupid, but maybe scrapers are, too...
> - push @hdr, 'application/mbox';
> + push @hdr, 'application/mbox; charset=UTF-8';
> $fn .= '.mbox';
> } else {
> - push @hdr, 'text/plain';
> + push @hdr, 'text/plain; charset=UTF-8';
> $fn .= '.txt';
Applied and pushed patches 1 + 2, thanks. This (3/3) seems
incorrect for non-UTF-8-compatible messages.
I should have a better approach for this in the next day or so.
The correct approach would be to use the Content-Type from the
$eml object, but the $eml object isn't likely in memory when
res_hdr() is called.
I was actually doing some surgery with the WwwStream /
GzipFilter async response components earlier, soI'll probably
get reading charset supported, soon.
Thanks for bringing this up.
next prev parent reply other threads:[~2021-10-25 0:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-24 21:43 [PATCH 1/3] t/watch_maildir: support non-master default branch Thomas Weißschuh
2021-10-24 21:43 ` [PATCH 2/3] t/git: " Thomas Weißschuh
2021-10-24 21:43 ` [PATCH 3/3] mbox: Specify encoding for raw message display Thomas Weißschuh
2021-10-25 0:08 ` Eric Wong [this message]
2021-10-25 5:42 ` Thomas Weißschuh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211025000824.GA20307@dcvr \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
--cc=thomas@t-8ch.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).