[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Lynx-dev] lynx newspost:// does not correctly encode non-7bit chars
From: |
Thorsten Glaser |
Subject: |
[Lynx-dev] lynx newspost:// does not correctly encode non-7bit chars |
Date: |
Sat, 11 May 2013 19:42:32 +0000 (UTC) |
Hi,
I discovered newsreply:// and newspost:// today and couldn’t resist
testing it: news://news.gmane.org/address@hidden
The nōn-7bit-ASCII characters break, and I can trace the real cause
of the breakage back to lynx. It really should encode the messages
as quoted-printable if and only if they contain non-7bit chars (as
MIME is otherwise still frowned upon in the Usenet).
Apparently, post_article() in W/L/I/HTNews.c is the culprit, but it
doesn’t handle the input at all. I believe I can change it to do
what I want, if you’d accept such a patch. One thing I’d need to
know is how to get the “current charset” (i.e. the one Lynx believes
the texteditor wrote).
Also, it doesn’t properly decode either:
news://news.gmane.org/address@hidden
This might be read_article() in the same file. It doesn’t do MIME
even for the bare Content-Transfer-Encoding minimum. I believe I
could change it to parse at least nōn-multipart messages in either
quoted-printable or base64 correctly, but then I’ve got a charset
to indicate to Lynx; how would I pass that on?
Another thing I’m missing, compared with reading nntp via pine,
is that lynx doesn’t offer to view the raw article, like this:
--- snip ---
# call this with one of:
# getarticle gmane.foo.bar 1234
# getarticle $message_id
# ensure ~/mail/x can be a unix/mbox format mail folder we append to
ns=news.gmane.org
if [[ $1 = -n ]]; then
ns=ncnntp
shift
fi
if (( $# == 2 )); then
printf 'mode reader\r\ngroup %s\r\narticle %d\r\nquit\r\n' "$1" "$2"
elif [[ $1 = */+([0-9]) ]]; then
printf 'mode reader\r\ngroup %s\r\narticle %d\r\nquit\r\n' "${1%/*}"
"${1##*/}"
else
printf 'mode reader\r\narticle <%s>\r\nquit\r\n' "$1"
fi | \
nc $ns 119 | sed -e $'s/\r$//' -e '1,/^[^0-9]/d' -e '/^\.$/,$d' | \
(date -u +'From MAILER-DAEMON %a %b %e %H:%M:%S %Y'; cat) >>~/mail/x
--- snip ---
This can be useful in debugging, or manually decoding messages
Lynx cannot parse. No idea how to add that best; the URL scheme
news://server/msgid isn’t really extensible, but newsraw:// might
be possible. I don’t currently offer an attempt at a patch.
bye,
//mirabilos
--
Sorry, I’m annoyed today and you came by as an Arch user. These are the
perfect victims for any crime against humanity, like systemd, feminism
or social democracy.
-- Christoph Lohmann on address@hidden
- [Lynx-dev] lynx newspost:// does not correctly encode non-7bit chars,
Thorsten Glaser <=