From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Water Lin Newsgroups: gmane.emacs.help Subject: Re: The text coding sytem for Emacs Date: Wed, 11 Nov 2009 10:36:21 +0800 Organization: A poorly-installed InterNetNews site Message-ID: <837htx7pp6.fsf@ymail.invalid> References: <833a4ttdik.fsf@ymail.invalid> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1257932026 12247 80.91.229.12 (11 Nov 2009 09:33:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Nov 2009 09:33:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 11 10:33:39 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N89YR-0004xZ-83 for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Nov 2009 10:31:55 +0100 Original-Received: from localhost ([127.0.0.1]:56281 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N89YQ-0005h8-Ow for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Nov 2009 04:31:54 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!newsfeed.berkeley.edu!ucberkeley!newsgate.cuhk.edu.hk!www.shinco.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 35 Original-NNTP-Posting-Host: 59.37.5.24 Original-X-Trace: www.shinco.com 1257906983 12990 59.37.5.24 (11 Nov 2009 02:36:23 GMT) Original-X-Complaints-To: news@www.shinco.com Original-NNTP-Posting-Date: Wed, 11 Nov 2009 02:36:23 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (windows-nt) Cancel-Lock: sha1:8N44YYUG56al4B4PT+XiDKG9stg= Original-Xref: news.stanford.edu gnu.emacs.help:174574 X-Mailman-Approved-At: Wed, 11 Nov 2009 04:22:57 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:69657 Archived-At: Eli Zaretskii writes: >> From: Water Lin >> 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. > > Yes, I am using Emacs 23.1. I fix this problem by adding (prefer-coding-system 'utf-8) to my .emacs file. Thanks Water Lin -- Water Lin's notes and pencils: http://en.waterlin.org Email: WaterLin@ymail.com