When I start chawan, there's a message saying "Error reading mailcap: line 1742: invalid character in command: �" with the last part being the replacement character. There seems to be no downside to this message, as the browser continues to work.
There are two issues, I think:
The first problem is more important. I'm looking at the output of "locate mailcap|grep '/mailcap$'" and there aren't many candidates. Of the candidates, none seems to have 1742 lines.
wc -l /etc/mailcap /usr/lib/mime/mailcap /usr/lib/mime/packages/mailcap 953 /etc/mailcap 26 /usr/lib/mime/mailcap 2 /usr/lib/mime/packages/mailcap 981 total
My thinking is that the warning should be more explicit about the filename being checked so that I can actually find the offending line.
I'm using Debian stable, downloaded the latest Nim compiler and checked out the lastest chawan sources.
Cheers Alex
Thanks for reporting.
[...]
- which file are we talking about?
As per cha-mailcap(5):
The search path for mailcap files is set by the configuration variable external.mailcap. This matches the recommended path in the RFC:
$HOME/.mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap
So, unless you have a .mailcap in $HOME, it is /etc/mailcap. (Other locations are unusual on Linux.)
- why an encoding error?
For some mysterious reason, the mailcap parser rejected non-ASCII characters. Let me know if the warning is gone with the latest commit.
The first problem is more important. I'm looking at the output of "locate mailcap|grep '/mailcap$'" and there aren't many candidates. Of the candidates, none seems to have 1742 lines.
Yeah, apparently I broke the line tracking logic at some point and never noticed :/ Should be fixed now.
[...] My thinking is that the warning should be more explicit about the filename being checked so that I can actually find the offending line.
Agreed. I've changed it to show the path name like the toml parser.
On Fri Apr 4, 2025 at 5:48 PM CEST, ~bptato wrote:
For some mysterious reason, the mailcap parser rejected non-ASCII characters. Let me know if the warning is gone with the latest commit.
Yes, I can confirm. Thank you very much. I've been a long time user of lynx, w3m and eww (in Emacs) and I find chawan to be super fascinating. Thanks for that, too.
Cheers Alex
On Fri Apr 4, 2025 at 5:48 PM CEST, ~bptato wrote:
For some mysterious reason, the mailcap parser rejected non-ASCII characters. Let me know if the warning is gone with the latest commit.
Yes, I can confirm.
Thanks for confirming.
Thank you very much. I've been a long time user of lynx, w3m and eww (in Emacs) and I find chawan to be super fascinating. Thanks for that, too.
Glad to hear that :)