acli / trn

trn + UTF-8 = ♥ // Unicode might look like trash on trn 4.0 test77, but if it’s open-source it can be fixed
https://github.com/acli/trn/wiki
Other
5 stars 1 forks source link

Posting creates 8bit articles with no QP or MIME headers #19

Open acli opened 4 years ago

acli commented 4 years ago

So posting an article containing non-ASCII characters will produce posts that are technically invalid and will potentially cause problems with the patched trn itself (once non-UTF8 output is supported).

acli commented 4 years ago

This is going to be a challenge. trn posts articles using Pnews, but Pnews is written in sh; it’d be tricky to do QP in sh.

Note: I reread the test articles I posted on aioe.test. The post with diacritics was incorrectly read as Latin1, so this is indeed confusing the patched trn itself.

acli commented 4 years ago

Temporary hack to make it technically semi-valid: d653d28804073e013e74963a46523d5e9e39f81f

Eli-the-Bearded commented 4 years ago

I've fixed Pnews and Rnmail for myself. I've got a sample of how I fixed Rnmail here: https://github.com/Eli-the-Bearded/eli-mailx/blob/master/rnmail.d/Rnmail because I also use Rnmail with mailx.

My technique is a tad naive. I have a program (part of that mailx package) that tests bit patterns for UTF-8, US-ASCII, and ISO-8859-1 compliance, setting an exit code. Then I check for a charset in the header and use the appropriate test. If out of compliance it warns the user, the same way long lines warn.