From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YOUNG Newsgroups: gmane.emacs.help Subject: Re: Convert UTF-8 Date: Wed, 17 Dec 2008 00:41:47 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <34c3af09-10d9-4b86-9683-08b37ccd4237@b41g2000pra.googlegroups.com> <1229480920.448497@arno.fh-trier.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1229506904 31083 80.91.229.12 (17 Dec 2008 09:41:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Dec 2008 09:41:44 +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 Dec 17 10:42:49 2008 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 1LCsvR-0003Tu-8C for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Dec 2008 10:42:41 +0100 Original-Received: from localhost ([127.0.0.1]:40886 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LCsuF-0001r1-4Y for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Dec 2008 04:41:27 -0500 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news2!postnews.google.com!u18g2000pro.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 54 Original-NNTP-Posting-Host: 76.93.136.148 Original-X-Trace: posting.google.com 1229503307 30683 127.0.0.1 (17 Dec 2008 08:41:47 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 17 Dec 2008 08:41:47 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: u18g2000pro.googlegroups.com; posting-host=76.93.136.148; posting-account=1n6WnAoAAACbXH3nD5I7RQWqdkbTxZki User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/0.4.154.33 Safari/525.19, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:165389 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:60719 Archived-At: On Dec 16, 11:54=A0pm, Harald Hanche-Olsen wrote: > + Andreas Politz : > > > YOUNG wrote: > > >> I have a Emacs 22.3.1 for Windows XP, and there is a file encoded in > >> ASCII. I am trying to read the file and convert it to UTF-8 with > >> emacs. > > > If I am not mistaken, converting a ASCII file to UTF-8 is an identity > > operation, since the later is backwards compatible to the former. So > > there would be nothing to convert. > > You are not at all mistaken of course, but many people take "ASCII" to > mean their favourite eight bit character set (typically Latin 1 or 9 in > western Europe). > > But since the OP reports no change to his files, maybe they really were > proper ASCII to begin with. Or maybe he is confused about how to make > emacs use UTF-8 when loading the file? If so, he could do worse than > read the emacs info file, node "Recognize coding". > > -- > * Harald Hanche-Olsen =A0 =A0 > - It is undesirable to believe a proposition > =A0 when there is no ground whatsoever for supposing it is true. > =A0 -- Bertrand Russell Well, I have no problem to load UTF-8 file with emacs at all. The problem is that emacs is not able to write UTF-8 at all. For example, if a file is encoded in ASCII (or, CP437, or ISO 8859 or Latin 1 to 9; there are various aliases to indicating of it, but you already know what it means.), I set it up with M-x set-buffer-file- coding-system for writing utf-8 encoding. And, write (or save) it. After that, exit the emacs and re-run it again, and try to read the saved file to be expected UTF-8 encoding, but it reads again in ASCII. It does not mean emacs can't read utf-8, but the file itself is not encoded UTF-8. I check the file's encoding system with other application like NotePAD++ or other editors, and all say the file is still ASCII mode even though I write it as utf-8 in emacs. Again, there is no problem in reading utf-8. When a file is encoded utf-8 correctly, emacs reads/writes it in utf-8. It's good. However, emacs is not able to write utf-8 if the file is encoded in ASCII. It only writes in ASCII encode no matter how I do "set-buffer-file-coding- system" So, if somebody knows this issue and how to write utf-8 correctly when a file is encoded in ISO8859 (or CP437 or ASCII), and if you share the information, it would be appreciated. Thanks,