GNU bug report logs -
#68971
Innocent file renders crazy
Previous Next
Reported by: Dan Jacobson <jidanni <at> jidanni.org>
Date: Wed, 7 Feb 2024 14:19:01 UTC
Severity: normal
Tags: notabug
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#68971: Innocent file renders crazy
which was filed against the emacs package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 68971 <at> debbugs.gnu.org.
--
68971: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68971
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
> From: Dan Jacobson <jidanni <at> jidanni.org>
> Cc: 68971 <at> debbugs.gnu.org
> Date: Thu, 08 Feb 2024 05:46:35 +0800
>
> OK, you are entirely right. It is all the file's fault and not emacs's.
>
> But on the other hand I wouldn't get far telling the Google Chrome team
> they should stop overriding charset declarations just to make things
> render good.
>
> In the end it's the emacs users who end up not being able to read the
> document.
>
> Maybe have some warning "wrong charset detected, proceed? [y,n,(a)utofix...]"
How can Emacs know, up front, that the charset is wrong? In general,
when a file claims some specific charset or encoding, Emacs believes
that and obeys. The "gibberish" is in the eyes of the beholder; Emacs
doesn't really understand human-readable text, and so doesn't know
whether what it presents is legible text or garbage caused by wrong
decoding.
> Else well, all the other users in the room are proceeding with their
> homework assignment, except Ralph, who uses emacs, which has gibberish
> on its screen, with no warnings.
What I did when I saw gibberish was to visit the file literally (as in
"M-x find-file-literally"), then, when I saw it was plain ASCII,
looked at its preamble, where I saw UTF-16, which explained why "C-x C-f"
shows gibberish. So when something like this happens, my suggestion
is:
. M-x find-file-literally
. look at the literal display: if its is readable, you can just
proceed with your home assignment
. alternatively, force Emacs to visit with the correct encoding, as
in "C-x RET c utf-8 RET C-x C-f metadata.html RET"
The "utf-8" part above was a guess, based on looking at the file when
visited literally; you may need to guess again if the results are not
good enough. See the node "Text Coding" in the Emacs user manual for
more about these facilities.
And with that, I'm closing this bug.
[Message part 3 (message/rfc822, inline)]
[Message part 4 (text/plain, inline)]
There is something crazy about this attached file that causes emacs to
display tons of weird characters.
$ md5sum metadata.html
42c875bae87988bbbd4db481b873bc1a metadata.html
$ emacs -Q metadata.html #crazy!
GNU Emacs 29.1
[metadata.html (text/html, attachment)]
This bug report was last modified 1 year and 134 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.