Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

weird character appears when autoviewing with w3m but doesn't appear when using w3m interactively or directly dumping from terminal #3580

Closed
milanglacier opened this issue Dec 16, 2022 · 5 comments · Fixed by #3656
Labels
bug:confirmed A NeoMutt developer can repeat this issue type:bug Bug

Comments

@milanglacier
Copy link

milanglacier commented Dec 16, 2022

Expected Behaviour

when autoview with w3m, there shouldn't be weird character "�"

Actual Behaviour

There appears weird character "�"

Steps to Reproduce

the following is my mailcap file:

text/html; w3m -I %{charset} -v -F -T text/html %s; nametemplate=%s.html; needsterminal;

text/html; w3m -I %{charset} -v -F -T text/html -dump %s; nametemplate=%s.html; copiousoutput; needsterminal;

and neomuttrc:

alternative_order text/html text/enriched text/plain

When comparing autoviewing html and using <view-mailcap> in the attach page to open w3m interactively, the autoviewed version has very strange "�" character.

Screen Shot 2022-12-15 at 22 54 13

but it does not appear in interactive w3m:

Screen Shot 2022-12-15 at 22 54 44

Notably, call w3m -I 'UTF-8' -v -F -dump example.html in the terminal does also not show the weird character:

Screen Shot 2022-12-15 at 22 57 04

The attachment is the html file:

hello.html.zip

How often does this happen?

  • It depends on the html file, for some html email, the display is fine, but for some html files, the problem always appear.

NeoMutt Version

PUT YOUR "neomutt -v" OUTPUT HERE

Copyright (C) 1996-2022 Michael R. Elkins and others.
NeoMutt comes with ABSOLUTELY NO WARRANTY; for details type 'neomutt -vv'.
NeoMutt is free software, and you are welcome to redistribute it
under certain conditions; type 'neomutt -vv' for details.

System: Darwin 21.6.0 (arm64)
ncurses: ncurses 6.3.20211021 (compiled with 6.3.20211021)
libiconv: 1.11
libidn2: 2.3.4 (compiled with 2.3.2)
GPGME: 1.17.1
OpenSSL: OpenSSL 1.1.1n 15 Mar 2022
libnotmuch: 5.6.0
storage: tokyocabinet, lmdb

Configure options: --prefix=/opt/homebrew/Cellar/neomutt/20220429 --gss --disable-idn --idn2 --lmdb --notmuch --sasl --tokyocabinet --with-gpgme=/opt/homebrew/opt/gpgme --with-lua=/opt/homebrew/opt/lua --with-ssl=/opt/homebrew/opt/openssl@1.1 --with-ui=ncurses

Compilation CFLAGS: -g -O2 -std=c99 -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__ -I/opt/homebrew/opt/gpgme/include -I/opt/homebrew/Cellar/libassuan/2.5.5/include -I/opt/homebrew/opt/libgpg-error/include -I/opt/homebrew/Cellar/neomutt/20220429/include -I/opt/homebrew/opt/lua/include/lua5.4 -DNCURSES_WIDECHAR -I/opt/homebrew/opt/openssl@1.1/include

Default options:
+attach_headers_color +compose_to_sender +compress +cond_date +debug
+encrypt_to_self +forgotten_attachments +forwref +ifdef +imap +index_color
+initials +limit_current_thread +multiple_fcc +nested_if +new_mail +nntp +pop
+progress +quasi_delete +regcomp +reply_with_xorig +sensible_browser +sidebar
+skip_quoted +smtp +status_color +timeout +tls_sni +trash

Compile options:
-autocrypt +fcntl -flock -fmemopen +futimens +getaddrinfo -gnutls +gpgme +gss
+hcache -homespool +idn -inotify -locales_hack +lua -mixmaster +nls +notmuch
+openssl +pgp +regex +sasl +smime -sqlite +sun_attachment

MAILPATH="/var/mail"
PKGDATADIR="/opt/homebrew/Cellar/neomutt/20220429/share/neomutt"
SENDMAIL="/usr/sbin/sendmail"
SYSCONFDIR="/opt/homebrew/Cellar/neomutt/20220429/etc"

To learn more about NeoMutt, visit: https://neomutt.org
If you find a bug in NeoMutt, please raise an issue at:
https://github.com/neomutt/neomutt/issues
or send an email to: neomutt-devel@neomutt.org

Extra Info

  • Operating System and its version

macOS 12.4

  • Were you using multiple copies of NeoMutt at once?

no

  • Were you using 'screen' or 'tmux'?

no

  • Is your email local (maildir) or remote (IMAP)?

maildir

@milanglacier milanglacier changed the title weird character appears when autoviewing with w3m but doesn't appear when use w3m interactively weird character appears when autoviewing with w3m but doesn't appear when usinb w3m interactively or directly from terminal Dec 16, 2022
@milanglacier milanglacier changed the title weird character appears when autoviewing with w3m but doesn't appear when usinb w3m interactively or directly from terminal weird character appears when autoviewing with w3m but doesn't appear when using w3m interactively or directly dumping from terminal Dec 16, 2022
@jindraj
Copy link
Member

jindraj commented Dec 16, 2022

Webmails and most of the GUI MUAs show the beginning of the message as a preview. E-mail producers generate their own customized text usually in a table cell or div with css display: none; to prevent displaying it when you open the message, but somehow it is taken into account for the preview. The mentioned characters are usually non breaking spaces or similar characters which are used to pad between the "preview" from the rest of the message to prevent actual content of the message leaking into the preview.

This is not a neomutt issue. I'm not sure if this is a correct behaviour of w3m or not.

@milanglacier
Copy link
Author

milanglacier commented Dec 16, 2022 via email

@jindraj
Copy link
Member

jindraj commented Dec 17, 2022

You're right about it. It seems there's is a problem displaying these characters in neomutt pager.

@gahr
Copy link
Member

gahr commented Jan 10, 2023

This is specifically not a non-breaking space (&nbsp;) but spaces with zero-with-non-joiner (&zwnj;) characters in between. See line 267 and following of your hello.html file.

I've dumped the file to text then opened it in vim (w3m w3m hello.html -dump > hello.txt; vim hello.txt) and I see a number of those characters as <200c> .

Perhaps our pager should be taught to ignore those characters.

@gahr gahr added the bug:confirmed A NeoMutt developer can repeat this issue label Jan 10, 2023
@gahr
Copy link
Member

gahr commented Jan 11, 2023

Please note that you'd see the same problem with a text file / text email containing those characters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:confirmed A NeoMutt developer can repeat this issue type:bug Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants