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: Tue, 27 May 2003 13:05:22 +0200 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: 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 1054034862 15491 80.91.224.249 (27 May 2003 11:27:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 27 May 2003 11:27:42 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Tue May 27 13:27:41 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 19KccG-00041T-00 for ; Tue, 27 May 2003 13:27:40 +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 19KcHW-0003HF-54 for gnu-help-gnu-emacs@m.gmane.org; Tue, 27 May 2003 07:06:14 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!nntp.cs.ubc.ca!fu-berlin.de!uni-berlin.de!dialin-145-254-195-017.arcor-ip.NET!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 43 Original-NNTP-Posting-Host: dialin-145-254-195-017.arcor-ip.net (145.254.195.17) Original-X-Trace: fu-berlin.de 1054033540 4021364 145.254.195.17 (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:6TrvbgsJmcGzfpXOESb1v5sxgJI= Original-Xref: shelby.stanford.edu gnu.emacs.help:113726 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:10220 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10220 Fery writes: [...] >> >> 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. > > I know, I know, but I am the user, I should know if it is safe... :) > >> Maybe the OP wants to visit files with `M-x find-file-literally'? > > Yes, this is what I wanted originally. :) But, without the existence of > a 'literal keyboard' it doesn't help _so_ much (although, I can edit the > non-utf-8 part of the file)... [...] I can not parse this. Maybe there's a misunderstanding here? When you hit a non-ascii key (like "ö" on a German keyboard), then Emacs inserts the 8bit code for ö in the ISO 8859-1 character encoding scheme (normally). This would be the octal code 366. [Note: This applies only to unibyte buffers. A buffer visiting a file with `find-file-literally' is a unibyte buffer.] What else do you want? Be aware that Emacs doesn't display this as some octal escape sequence (or some such) but as the actual glyph "ö". [If you think this latter thing is bad, then you are not the only one and I could post some Elisp code, which remedies this.] Note, however, that the 8bit codes from the right hand part of the Latin 1 CES are *not* allowed octetts in UTF-8. So inserting an ö will break your UTF-8 encoding. So maybe you want -- on the contrary -- Emacs to insert the correct UTF-8 octetts corresponding to the character on you keyboard (which is definitely not "literally")? Oliver -- 8 Prairial an 211 de la Révolution Liberté, Egalité, Fraternité!