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: Convert UTF-8 Date: Wed, 17 Dec 2008 04:04:17 -0800 (PST) Organization: http://groups.google.com Message-ID: <647e8cdc-381d-48a4-ab4c-25a7a52596d7@r15g2000prh.googlegroups.com> 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=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1229522309 16797 80.91.229.12 (17 Dec 2008 13:58:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Dec 2008 13:58:29 +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 14:59:29 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 1LCwvs-0002HX-1x for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Dec 2008 14:59:24 +0100 Original-Received: from localhost ([127.0.0.1]:34094 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LCwug-0007uS-4l for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Dec 2008 08:58:10 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!r15g2000prh.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 49 Original-NNTP-Posting-Host: 76.102.50.240 Original-X-Trace: posting.google.com 1229515458 16575 127.0.0.1 (17 Dec 2008 12:04:18 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 17 Dec 2008 12:04:18 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: r15g2000prh.googlegroups.com; posting-host=76.102.50.240; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:165395 X-Mailman-Approved-At: Wed, 17 Dec 2008 08:52:12 -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:60728 Archived-At: On Dec 17, 12:41 am, YOUNG wrote: > 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, as other have mentioned, utf-8 is just a super set of ascii, so files encoded in either are identical. You mentioned ISO8859, which is not ascii. I read your 2 posts, but don't quite understand what you wanted. For some unicode with emacs tips, you might checkout: =E2=80=A2 Emacs and Unicode Tips http://xahlee.org/emacs/emacs_n_unicode.html You might also beefup understanding of char encoding: http://en.wikipedia.org/wiki/ISO8859 http://en.wikipedia.org/wiki/ASCII http://en.wikipedia.org/wiki/UTF-8 Xah =E2=88=91 http://xahlee.org/ =E2=98=84