Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

The text coding sytem for Emacs

1 view
Skip to first unread message

Water Lin

unread,
Nov 5, 2009, 6:30:27 AM11/5/09
to

I re-install my Windows XP system. But after I start Emacs, it treats my
text file as iso-latin-1-unix. But actually the coding system should be
utf-8. So Emacs shows the text as a mess.

When I change the coding to UTF-8 by M-x
revert-buffer-with-coding-system, the text file works normally.

How can I let Emacs to treat text file as UTF-8 by default?

Thanks

Water Lin

--
Water Lin's notes and pencils: http://en.waterlin.org
Email: Wate...@ymail.com

Eli Zaretskii

unread,
Nov 6, 2009, 3:19:48 AM11/6/09
to help-gn...@gnu.org
> From: Water Lin <Wate...@ymail.invalid>
> Date: Thu, 05 Nov 2009 19:30:27 +0800

>
>
> I re-install my Windows XP system. But after I start Emacs, it treats my
> text file as iso-latin-1-unix. But actually the coding system should be
> utf-8. So Emacs shows the text as a mess.

What version of Emacs is that? With Emacs 23.1 I think this shouldn't
happen (barring some rare bug). If you don't have Emacs 23.1, can you
upgrade?

> How can I let Emacs to treat text file as UTF-8 by default?

For this file only, or for all files?

For the latter `(prefer-coding-system 'utf-8)' in your .emacs should
do, I think. For the former, you can add a `coding:' cookie to the
file.


Water Lin

unread,
Nov 10, 2009, 9:36:21 PM11/10/09
to
Eli Zaretskii <el...@gnu.org> writes:

Yes, I am using Emacs 23.1. I fix this problem by adding
(prefer-coding-system 'utf-8)
to my .emacs file.

0 new messages