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

Problem with brotli compression #112

Closed
chipschap opened this issue Nov 7, 2022 · 5 comments
Closed

Problem with brotli compression #112

chipschap opened this issue Nov 7, 2022 · 5 comments

Comments

@chipschap
Copy link

chipschap commented Nov 7, 2022

I noticed a while ago after some updates that some web sites stopped rendering correctly and produced binary-looking buffers. I didn't resolve this. A little later another person mentioned the same thing in the emacs help mailing list. But some others don't have the problem. I tracked it down and it appears to be that emacs-w3m doesn't have a "brotli" handler for brotli web page compression, as used by slashdot, duckduckgo, and others. Strangely this only seems to affect the later versions of the w3m command; earlier versions seem okay although I can't be more specific about which versions.

I added two lines of code that for me and the other user resolve the problem. The patch requires that the "brotli" command be in the command path. I don't check for this. I didn't generate a diff but the following in w3m.el should be hopefully clear enough. This has been tested on Endeavour (Arch), OpenBSD, and Debian systems.

defcustom w3m-decoder-alist should add this line to the list of types

(br "brotli" ("-d"))

defconst w3m-encoding-alist should add this line to the list of types

	     (br . ("br"))

I hope this is of some use.

yamaoka added a commit that referenced this issue Nov 7, 2022
* w3m.el (w3m-decoder-alist, w3m-encoding-alist): Add brotli.
@yamaoka
Copy link
Contributor

yamaoka commented Nov 7, 2022

Thank you very much for the information. I've added the brotli entry to w3m-decoder-alist and w3m-encoding-alist.

Though I've never faced with such a page seen like binary, I've installed the brotli executable in my box. ;-)

@yamaoka yamaoka closed this as completed Nov 7, 2022
@Boruch-Baum
Copy link
Contributor

Boruch-Baum commented Nov 8, 2022 via email

@chipschap
Copy link
Author

I am using w3m 0.5.3.git20220409_1-2 and I can't find the option accept_encoding in the documentation. I don't have a w3m config file at all so I suspect w3m accepts brotli but then emacs-w3m couldn't previously deal with it. The problem here dates from about the time you mention --- early in 2021 when you point out that brotli support was added to w3m.

But in any event, having emacs-w3m being capable of handling brotli is a bit of a step forward, I think.

@Boruch-Baum
Copy link
Contributor

Boruch-Baum commented Nov 9, 2022 via email

@chipschap
Copy link
Author

chipschap commented Nov 9, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants