all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Harald Hanche-Olsen <hanche@math.ntnu.no>
To: help-gnu-emacs@gnu.org
Subject: Re: Convert UTF-8
Date: Thu, 18 Dec 2008 15:56:52 +0100	[thread overview]
Message-ID: <pcor645h6q3.fsf@math.ntnu.no> (raw)
In-Reply-To: 8611f412-9a43-4325-8c60-0cb620e8a206@y1g2000pra.googlegroups.com

+ YOUNG <breadncup@gmail.com>:

> I could conclude emacs does not have the feature of having BOM in
> utf-8. It only supports utf-8 without BOM.

Not true. But you have to put the BOM (ZERO WIDTH NO-BREAK SPACE,
really) there yourself, since otherwise as you noted (in the elided
text) it can play havoc with shell scripts etc. If you want, e.g., every
file that is visited in text mode to start with a BOM you can add a hook
function to before-save-hook that ensures this before saving.

Also, at least the emacsen I am currently using (version 23 from CVS)
will recognize an initial BOM and automagically pick the utf-8 encoding
when it sees the corresponding three bytes at the top of the file.

> Detailed information about unicode and BOM is found in
> http://unicode.org/faq/utf_bom.html

The use of zero width no-break space as a marker to indicate coding is
also widely regarded as unwise. I am too lazy to find any of the
references that will support my claim, so take it with a grain of salt
if you will.

-- 
* 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


  reply	other threads:[~2008-12-18 14:56 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
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 [this message]
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=pcor645h6q3.fsf@math.ntnu.no \
    --to=hanche@math.ntnu.no \
    --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.