Bug 297477 - The UTF-8 characters in mailing list subjects are appearing garbled
Summary: The UTF-8 characters in mailing list subjects are appearing garbled
Status: In Progress
Alias: None
Product: Services
Classification: Unclassified
Component: Mailing Lists (show other bugs)
Version: unspecified
Hardware: Any Any
: --- Affects Many People
Assignee: Wolfram Schneider
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-08-12 17:01 UTC by Yuri Victorovich
Modified: 2026-08-17 18:59 UTC (History)
5 users (show)

See Also:


Attachments
getmsg-fixed.tgz (7.48 KB, application/octet-stream)
2026-08-12 20:33 UTC, Yuri Victorovich
no flags Details
mailindex-fixed.tgz (17.77 KB, application/octet-stream)
2026-08-17 05:08 UTC, Yuri Victorovich
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2026-08-12 17:01:00 UTC
For example here: https://mail-archive.freebsd.org/mail/archive/2026/dev-commits-ports-all/20260803.dev-commits-ports-all.html

Could anybody please point me to how are these displayed (is it a PHP script?) and I'd try to fix it.
Comment 1 Kousuke Kannagi freebsd_committer freebsd_triage 2026-08-12 17:34:16 UTC
You can decode it using `japanese/nkf`, but is that not what you meant?

$ echo '=?UTF-8?B?UmU6IGdpdDogNDVjMTQyOTdiMTkxIC0gbWFpbiAtIHNlY3VyaXR5L3B5LWdvb2dsZS1hdQ==?= =?UTF-8?B?dGg6IHVwZGF0ZSAyLjU1LjIg4oaSIDIuNTYuMg==?='|nkf -m
Re: git: 45c14297b191 - main - security/py-google-auth: update 2.55.2 → 2.56.2
Comment 2 Kurt Jaeger freebsd_committer freebsd_triage 2026-08-12 18:15:13 UTC
We have several interfaces for mailing lists.

 https://mail-archive.freebsd.org/mail/archive/

is one of them. The getmsg.cgi is written in perl, and probably has problems with multiline UTF-8 subjects. You can find it in the clusteradm svn repo at
www/mailarchive.nyi/cgi/getmsg.cgi

 https://lists.freebsd.org/archives/

is another, more recently developed one. The same message:

https://lists.freebsd.org/archives/dev-commits-ports-all/2026-August/219152.html

has a readable subject in that archive.
Comment 3 Kurt Jaeger freebsd_committer freebsd_triage 2026-08-12 18:34:12 UTC
(In reply to Kurt Jaeger from comment #2)
Aha, RFC2047 specifies those header line encodings. The pointer to nkf is really helpful 8-)
Comment 4 Yuri Victorovich freebsd_committer freebsd_triage 2026-08-12 18:56:57 UTC
Somehow when I click on the "archive" link in https://mail-archive.freebsd.org/mail/archive/2026/dev-commits-ports-all/20260803.dev-commits-ports-all.html this archive doesn't show the same messages as the html page.

Specifically, the word "folly" appears on the html page but not in the archive itself.

Furthermore, wget fails to download this archive and keeps retrying. Something isn't right with this web server.


$ wget "https://mail-archive.freebsd.org/cgi/getmsg.cgi?fetch=0+0+archive/2026/dev-commits-ports-all/20260803.dev-commits-ports-all+archive" -O archive.mbox
--2026-08-12 11:55:44--  https://mail-archive.freebsd.org/cgi/getmsg.cgi?fetch=0+0+archive/2026/dev-commits-ports-all/20260803.dev-commits-ports-all+archive
Resolving mail-archive.freebsd.org (mail-archive.freebsd.org)... 96.47.72.84, 2610:1c1:1:606c::50:15
Connecting to mail-archive.freebsd.org (mail-archive.freebsd.org)|96.47.72.84|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: ‘archive.mbox’

archive.mbox                                                       [   <=>                                                                                                                                              ] 192.00K   420KB/s    in 0.5s    

2026-08-12 11:55:45 (420 KB/s) - Read error at byte 196608 (No error: 0).Retrying.

--2026-08-12 11:55:46--  (try: 2)  https://mail-archive.freebsd.org/cgi/getmsg.cgi?fetch=0+0+archive/2026/dev-commits-ports-all/20260803.dev-commits-ports-all+archive
Connecting to mail-archive.freebsd.org (mail-archive.freebsd.org)|96.47.72.84|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: ‘archive.mbox’

archive.mbox                                                       [  <=>                                                                                                                                               ] 192.00K   483KB/s    in 0.4s    

2026-08-12 11:55:46 (483 KB/s) - Read error at byte 196608 (No error: 0).Retrying.

--2026-08-12 11:55:48--  (try: 3)  https://mail-archive.freebsd.org/cgi/getmsg.cgi?fetch=0+0+archive/2026/dev-commits-ports-all/20260803.dev-commits-ports-all+archive
Connecting to mail-archive.freebsd.org (mail-archive.freebsd.org)|96.47.72.84|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: ‘archive.mbox’

archive.mbox                                                       [   <=>                                                                                                                                              ] 192.00K   421KB/s    in 0.5s    

2026-08-12 11:55:49 (421 KB/s) - Read error at byte 196608 (No error: 0).Retrying.

--2026-08-12 11:55:52--  (try: 4)  https://mail-archive.freebsd.org/cgi/getmsg.cgi?fetch=0+0+archive/2026/dev-commits-ports-all/20260803.dev-commits-ports-all+archive
Connecting to mail-archive.freebsd.org (mail-archive.freebsd.org)|96.47.72.84|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: ‘archive.mbox’

archive.mbox                                                       [   <=>                                                                                                                                              ] 256.00K   512KB/s    in 0.5s    

2026-08-12 11:55:53 (512 KB/s) - Read error at byte 262144 (No error: 0).Retrying.
Comment 5 Yuri Victorovich freebsd_committer freebsd_triage 2026-08-12 20:33:32 UTC
Created attachment 273691 [details]
getmsg-fixed.tgz

Kurt sent me the archive getmsg.tgz that has the CGI Perl script to display an individual message.

I fixed UTF-8 handling there - no garbled content any more.

What was fixed:
1. MIME-encoded subject line was decoded and converted to the HTML format
2. Immediate UTF-8 chars in the message body are now properly displayed.

The script that shows the list of ML messages is still missing.
I am asking Kurt via e-mail about it.
Comment 6 Yuri Victorovich freebsd_committer freebsd_triage 2026-08-12 21:01:15 UTC
The ML fetching issue: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297485
Comment 7 Philip Paeps freebsd_committer freebsd_triage 2026-08-12 23:05:54 UTC
Cc: wosch@ who maintains this script.
Comment 8 Yuri Victorovich freebsd_committer freebsd_triage 2026-08-13 17:30:12 UTC
(In reply to Kousuke Kannagi from comment #1)

No, the decoding is done generically for any UTF-8 chars, not just Japanese.
Comment 9 Yuri Victorovich freebsd_committer freebsd_triage 2026-08-13 17:36:49 UTC
I don't know how to get to clusteradm svn repo at
www/mailarchive.nyi/cgi/getmsg.cgi

Could somebody please send me, attach, or point to the CGI script that displays the list of ML messages in the first URL that I've posted?
Comment 10 Kurt Jaeger freebsd_committer freebsd_triage 2026-08-13 18:01:42 UTC
(In reply to Yuri Victorovich from comment #9)
It's www/mailarchive.nyi/mailindex/ (some dirs etc) in the clusteradm repo, sent by mail. wosch@, can you work with yuri to get the patches into production ?
Comment 11 Yuri Victorovich freebsd_committer freebsd_triage 2026-08-13 20:11:13 UTC
About the failing file download: wget fails but the following brute-force style command keeps re-connecting and succeeds eventually:

> aria2c --allow-overwrite=true -m 100 "https://mail-archive.freebsd.org/cgi/getmsg.cgi?fetch=0+0+archive/2026/dev-commits-ports-all/20260706.dev-commits-ports-all+archive" -o archive.mbox
Comment 12 Kousuke Kannagi freebsd_committer freebsd_triage 2026-08-13 23:30:31 UTC
(In reply to Yuri Victorovich from comment #8)
$ echo '=?UTF-8?B?UmU6IGdpdDogNDVjMTQyOTdiMTkxIC0gbWFpbiAtIHNlY3VyaXR5L3B5LWdvb2dsZS1hdQ==?= =?UTF-8?B?dGg6IHVwZGF0ZSAyLjU1LjIg4oaSIDIuNTYuMg==?='|nkf -m | file -
/dev/stdin: Unicode text, UTF-8 text
Comment 13 Wolfram Schneider freebsd_committer freebsd_triage 2026-08-15 08:57:44 UTC
I added support for MIME mail headers in getmsg.cgi. I will fix mailindex.cgi later - this is more work.
Comment 14 Yuri Victorovich freebsd_committer freebsd_triage 2026-08-15 14:44:03 UTC
(In reply to Wolfram Schneider from comment #13)

Hi Wolfram,

I have a fix which I will post here over this weekend (it had wrinkle so I didn't post it yet).
Please don't waste your time.


Thanks,
Yuri
Comment 15 Yuri Victorovich freebsd_committer freebsd_triage 2026-08-17 05:08:36 UTC
Created attachment 273841 [details]
mailindex-fixed.tgz

List view is fixed.
Comment 16 Wolfram Schneider freebsd_committer freebsd_triage 2026-08-17 18:59:46 UTC
(In reply to Yuri Victorovich from comment #15)
Thanks, I will look at the patches soon.