all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Convert UTF-8
Date: Wed, 17 Dec 2008 10:59:46 +0100	[thread overview]
Message-ID: <87iqpjjf59.fsf@tux.homenetwork> (raw)
In-Reply-To: e1c34833-ae13-4935-92fa-1024e495ac23@u18g2000pro.googlegroups.com

YOUNG <breadncup@gmail.com> writes:

> On Dec 16, 11:54 pm, Harald Hanche-Olsen <han...@math.ntnu.no> wrote:
>> + Andreas Politz <poli...@fh-trier.de>:
>>
>> > 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     <URL:http://www.math.ntnu.no/~hanche/>
>> - It is undesirable to believe a proposition
>>   when there is no ground whatsoever for supposing it is true.
>>   -- 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.

I was using iso-8859-15 before switching my system to utf-8.
I just add to my files: (not -*- utf-8 encoding -*-)

,----
| # -*- coding: utf-8 -*-
`----

instead of 

,----
| # -*- coding: iso-8859-15 -*-
`----

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France





  reply	other threads:[~2008-12-17  9:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-17  1:05 Convert UTF-8 YOUNG
2008-12-17  2:27 ` Andreas Politz
2008-12-17  7:54   ` Harald Hanche-Olsen
2008-12-17  8:41     ` YOUNG
2008-12-17  9:59       ` Thierry Volpiatto [this message]
2008-12-17 11:17       ` Giorgos Keramidas
2008-12-17 12:04       ` Xah Lee
2008-12-18  8:35         ` YOUNG
2008-12-18 14:56           ` Harald Hanche-Olsen
2008-12-17 10:43 ` Peter Dyballa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87iqpjjf59.fsf@tux.homenetwork \
    --to=thierry.volpiatto@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.