From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Oliver Scholz Newsgroups: gmane.emacs.help Subject: Re: problem with editing/decoding utf-8 text Date: Fri, 23 May 2003 21:23:38 +0200 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <843cj5hakf.fsf@lucy.is.informatik.uni-duisburg.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1053718022 6863 80.91.224.249 (23 May 2003 19:27:02 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 23 May 2003 19:27:02 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Fri May 23 21:26:54 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19JIBp-0001ll-00 for ; Fri, 23 May 2003 21:26:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19JIAZ-00058K-Pv for gnu-help-gnu-emacs@m.gmane.org; Fri, 23 May 2003 15:25:35 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!peernews3.colt.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!dialin-145-254-193-188.arcor-ip.NET!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 50 Original-NNTP-Posting-Host: dialin-145-254-193-188.arcor-ip.net (145.254.193.188) Original-X-Trace: fu-berlin.de 1053717828 1371171 145.254.193.188 (16 [87814]) X-Attribution: os X-Face: "HgH2sgK|bfH$; PiOJI6|qUCf.ve<51_Od(%ynHr?=>znn#~#oS>",F%B8&\vus),2AsPYb -n>PgddtGEn}s7kH?7kH{P_~vu?]OvVN^qD(L)>G^gDCl(U9n{:d>'DkilN!_K"eNzjrtI4Ya6;Td% IZGMbJ{lawG+'J>QXPZD&TwWU@^~A}f^zAb[Ru;CT(UA]c& User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3.50 (windows-nt) Cancel-Lock: sha1:Li9uBP5PE4FjoMRh8PSR2lDiim4= Original-Xref: shelby.stanford.edu gnu.emacs.help:113635 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10131 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10131 kai.grossjohann@gmx.net (Kai Großjohann) writes: > Fery writes: > >> I have a UTF-8 text file, containing latin-1 text. When I try to edit it >> with emacs, it does not detect that it is utf-8; the >> describe-coding-system gives back 'iso-latin-1-unix'. (And I see the >> two-byte representation of latin1 chars, which is not bad to me.) > > Released versions of Emacs put UTF-8 at a rather low priority for > automatic encoding detection. So you need to help Emacs by > explicitly specifying the encoding. Do C-x RET c utf-8 RET before > using C-x C-f to open the file. > > You can also put utf-8 somewhat earlier in the list for automatic > encoding detection. I think this can be achieved in the following > way, but I'm not sure. I'm not a Mule expert. If anyone knows > better, please help out. > > (setq coding-category-list > (cons 'coding-category-utf-8 > (delq 'coding-cateogcoding-utf-8 > coding-category-list))) > Not 100% if this really makes a difference -- (set-coding-priority (list 'coding-category-utf-8)) maybe? If you want UTF-8 to be the default for new files: (prefer-coding-system 'utf-8) [...] >> 1. Cannot I tell to a buffer (after the load of a file) that interpet it >> as binary, and save exactly the same bytes what it did read into the >> buffer (i.e. transparent buffer)? > > It's not a good idea. The buffer contents might already be munged at > that point. [...] Maybe the OP wants to visit files with `M-x find-file-literally'? Oliver -- 4 Prairial an 211 de la Révolution Liberté, Egalité, Fraternité!