From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: Opening file in UTF-8 mode automatically Date: Sun, 25 Nov 2007 14:49:23 -0800 (PST) Organization: http://groups.google.com Message-ID: <941d8552-9779-4a2c-bc37-46696e033056@e25g2000prg.googlegroups.com> References: <78b46aa5-064f-4977-b425-b30a2f1866bb@a39g2000pre.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1196034064 31673 80.91.229.12 (25 Nov 2007 23:41:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Nov 2007 23:41:04 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 26 00:41:01 2007 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 1IwR5s-0000tT-4R for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Nov 2007 00:40:56 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IwR5d-0007Yh-6G for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Nov 2007 18:40:41 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!e25g2000prg.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 39 Original-NNTP-Posting-Host: 69.236.97.82 Original-X-Trace: posting.google.com 1196030963 27151 127.0.0.1 (25 Nov 2007 22:49:23 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 25 Nov 2007 22:49:23 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e25g2000prg.googlegroups.com; posting-host=69.236.97.82; posting-account=qPxGtQkAAADb6PWdLGiWVucht1ZDR6fn User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/523.12 (KHTML, like Gecko) Version/3.0.4 Safari/523.12, gzip(gfe), gzip(gfe) Content-Disposition: inline Original-Xref: shelby.stanford.edu gnu.emacs.help:154091 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:49530 Archived-At: Not sure about auto-detecting, but i work with utf-8 daily and never have a problem. I do, however, set my emacs to use utf-8 by default. To set your file encoding in emacs, use the menu "Options$B"*(BMule (Multilingual Environment)$B"*(BSet Language Environment". After you've pulled the menu, be sure to also pull the menu command "Options$B"*(BSave Options" so that emacs remembers your settings. or Alt+x set-language-environment UTF-8 See also: * Emacs and Unicode tips http://xahlee.org/emacs/emacs_n_unicode.html Xah xah@xahlee.org $B-t(B http://xahlee.org/ On Nov 24, 8:38 am, "spamfilteracco...@gmail.com" wrote: > I need to edit some UTF-8 files and it's very annoying emacs doesn't > detect it automatically (I have to reopen them as utf-8 manually) and > sometimes I notice it only after I already edited and saved the file > which messes up the formatting. > > I tried prefer-coding-system utf-8, but it didn't help. > > I can't put lisp code into the files, because they are data files. > > Is there a definitive way to do it? The BOM is at the beginning of the > files, so Emacs could detect it automatically. > > It's emacs 22.