* Garbage display when NULL in file
@ 2009-03-07 16:27 Gregory Sharp
2009-03-07 19:27 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Gregory Sharp @ 2009-03-07 16:27 UTC (permalink / raw)
To: help-gnu-emacs
In my current debian emacs (22.2.1), emacs seems to be incorrectly
detecting the codeset for files with mixed ascii/data. The problem
is that I get a garbage display (squares, kanji, etc.). How can
I tell emacs not to detect the codeset (or revert to ascii/utf8
after it autodetects)?
Here is the stuff I want it to stop doing:
Loading subst-ksc...done
Loading subst-gb2312...done
Loading subst-big5...done
Loading subst-jis...done
Loading composite...done
--
Greg Sharp
gregsharp@geocities.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Garbage display when NULL in file
2009-03-07 16:27 Garbage display when NULL in file Gregory Sharp
@ 2009-03-07 19:27 ` Eli Zaretskii
0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2009-03-07 19:27 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Sat, 7 Mar 2009 08:27:56 -0800 (PST)
> From: Gregory Sharp <gregsharp.geo@yahoo.com>
>
>
>
> In my current debian emacs (22.2.1), emacs seems to be incorrectly
> detecting the codeset for files with mixed ascii/data. The problem
> is that I get a garbage display (squares, kanji, etc.). How can
> I tell emacs not to detect the codeset (or revert to ascii/utf8
> after it autodetects)?
C-x RET c us-ascii RET C-x C-x your-file RET
Does this do what you want?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Garbage display when NULL in file
@ 2009-03-08 15:08 Gregory Sharp
2009-03-08 19:15 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Gregory Sharp @ 2009-03-08 15:08 UTC (permalink / raw)
To: help-gnu-emacs
> > In my current debian emacs (22.2.1), emacs seems to be incorrectly
> > detecting the codeset for files with mixed ascii/data. The problem
> > is that I get a garbage display (squares, kanji, etc.). How can
> > I tell emacs not to detect the codeset (or revert to ascii/utf8
> > after it autodetects)?
>
> C-x RET c us-ascii RET C-x C-x your-file RET
>
> Does this do what you want?
Yes! Thank you for the hint. The following also works:
C-x RET c utf-8 RET C-x C-f your-file RET
Why doesn't emacs use utf-8 (my locale codeset) for this file?
Can I make this behavior the default?
--
Greg Sharp
gregsharp@geocities.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Garbage display when NULL in file
2009-03-08 15:08 Gregory Sharp
@ 2009-03-08 19:15 ` Eli Zaretskii
2009-03-09 1:19 ` Samuel Wales
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2009-03-08 19:15 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Sun, 8 Mar 2009 08:08:56 -0700 (PDT)
> From: Gregory Sharp <gregsharp.geo@yahoo.com>
>
>
> > > In my current debian emacs (22.2.1), emacs seems to be incorrectly
> > > detecting the codeset for files with mixed ascii/data. The problem
> > > is that I get a garbage display (squares, kanji, etc.). How can
> > > I tell emacs not to detect the codeset (or revert to ascii/utf8
> > > after it autodetects)?
> >
> > C-x RET c us-ascii RET C-x C-x your-file RET
> >
> > Does this do what you want?
>
> Yes! Thank you for the hint. The following also works:
>
> C-x RET c utf-8 RET C-x C-f your-file RET
>
> Why doesn't emacs use utf-8 (my locale codeset) for this file?
Probably because the file includes some data that looks like encoded
Far-Eastern characters. The locale's encoding is just the preferred
one, but if there are strong signs of a different encoding, Emacs will
use that.
> Can I make this behavior the default?
What, you want every single file be read as UTF-8? I don't recommend
that.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Garbage display when NULL in file
[not found] <mailman.2697.1236524942.31690.help-gnu-emacs@gnu.org>
@ 2009-03-08 23:26 ` Miles Bader
0 siblings, 0 replies; 7+ messages in thread
From: Miles Bader @ 2009-03-08 23:26 UTC (permalink / raw)
To: help-gnu-emacs
Gregory Sharp <gregsharp.geo@yahoo.com> writes:
> Yes! Thank you for the hint. The following also works:
>
> C-x RET c utf-8 RET C-x C-f your-file RET
>
> Why doesn't emacs use utf-8 (my locale codeset) for this file?
Your data files (apparently) contain code sequences which are invalid
utf-8, so emacs (quite reasonably I think) by default then decides they
must not be encoded using utf-8, and tries to find some other coding
system that appears to work.
By using the above command, you've overridden the default behavior and
told emacs to use utf-8 despite the bogus encoding.
The info node `(emacs) Recognize Coding' talks about this.
-Miles
--
Somebody has to do something, and it's just incredibly pathetic that it
has to be us. -- Jerry Garcia
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Garbage display when NULL in file
2009-03-08 19:15 ` Eli Zaretskii
@ 2009-03-09 1:19 ` Samuel Wales
2009-03-09 4:09 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Samuel Wales @ 2009-03-09 1:19 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
On Sun, Mar 8, 2009 at 12:15, Eli Zaretskii <eliz@gnu.org> wrote:
> What, you want every single file be read as UTF-8? I don't recommend
> that.
What's a good, very short executive level summary of the issues?
If I paste into a plain ASCII file some ridiculous version of -- or '
or `, am I OK answering utf-8 for what emacs asks me?
Same for CJK?
--
Myalgic encephalomyelitis denialism is causing death (decades early;
Jason et al. 2006) and severe suffering (worse than nearly all other
diseases studied; e.g. Schweitzer et al. 1995) and *grossly*
corrupting science.
http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Garbage display when NULL in file
2009-03-09 1:19 ` Samuel Wales
@ 2009-03-09 4:09 ` Eli Zaretskii
0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2009-03-09 4:09 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Sun, 8 Mar 2009 18:19:55 -0700
> From: Samuel Wales <samologist@gmail.com>
> Cc: help-gnu-emacs@gnu.org
>
> On Sun, Mar 8, 2009 at 12:15, Eli Zaretskii <eliz@gnu.org> wrote:
> > What, you want every single file be read as UTF-8? I don't recommend
> > that.
>
> What's a good, very short executive level summary of the issues?
Too many files you encounter nowadays as a matter of routine are not
UTF-8 encoded. If you tell Emacs to always assume UTF-8, you will get
garbage displayed in those files.
> If I paste into a plain ASCII file some ridiculous version of -- or '
> or `, am I OK answering utf-8 for what emacs asks me?
Yes, you should be OK. But the issue here was not how to save the
buffer, the issue was how to make sure it is displayed correctly after
visiting a file.
> Same for CJK?
If Emacs mentions UTF-8 among the possible encodings it suggests, then
yes, you are safe with CJK as well.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-03-09 4:09 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-07 16:27 Garbage display when NULL in file Gregory Sharp
2009-03-07 19:27 ` Eli Zaretskii
-- strict thread matches above, loose matches on Subject: below --
2009-03-08 15:08 Gregory Sharp
2009-03-08 19:15 ` Eli Zaretskii
2009-03-09 1:19 ` Samuel Wales
2009-03-09 4:09 ` Eli Zaretskii
[not found] <mailman.2697.1236524942.31690.help-gnu-emacs@gnu.org>
2009-03-08 23:26 ` Miles Bader
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.