all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
Cc: emacs-devel@gnu.org
Subject: Re: coding tags and utf-16
Date: Tue, 28 Feb 2006 10:08:36 +0900	[thread overview]
Message-ID: <E1FDtLw-0005XV-00@etlken> (raw)
In-Reply-To: <dse2i6$d2b$1@sea.gmane.org> (message from Kevin Rodgers on Wed,  08 Feb 2006 17:32:02 -0700)

Sorry for the late responce.

In article <dse2i6$d2b$1@sea.gmane.org>, Kevin Rodgers <ihs_4664@yahoo.com> writes:

>> I thought we had discussed this already.  The BOM-encodings should
>> have priority since the likelihood of a misdetection is negligible
>> (the character pair does not make sense at the start of a text in
>> latin-1 in any language): the only thing that can reasonably be
>> expected to happen is that a binary file is detected as utf-16.  Not
>> much of an issue, I'd say.

I've just digged out old mails we exchanged on this topic
(about a year ago).  To my understanding, there was no
clear conclusion.  Here are the extracts:
------------------------------------------------------------
I wrote:
> I think BOM is not that safe because there are many charsets
> who have normal letters at 0xFE and 0xFF.

Jason wrote:
> But what are those characters, and are they likely to appear as a pair 
> at the beginning of the file, and nowhere else?

I wrote:
> Sorry, I don't know.

Dave wrote:
>> Exactly what Windows does for what?  Recognizing a utf-16 registry
>> file when opened in the registry editor?

> Auto-detecting utf-16 generally.  Although I don't think it would give
> false positives on iso-8859 text, I don't know if it could with other
> charsets.
> 
> I could believe that Windows doesn't just go by byte-order-mark in
> some locales where there might be a problem.  If so, it could be
> useful to do the same thing.
------------------------------------------------------------

For instance, I've just googled the two character sequence
of 0xFE 0xFF of koi8 and found several occurrences.

> Exactly.  So why haven't these entries been added to 
> auto-coding-regexp-alist?

> ("\\`\xEF\xBB\xBF" . utf-8)

As far as I know, UTF-8 should not start with this sequence
unless the text really starts with ZWNBSP (very unlikely).

> ("\\`\xFE\xFF" . utf-16-be)
> ("\\`\xFF\xFE" . utf-16-le)

Although it's not clear how safe they are, if no one objects,
I'll add them in auto-coding-regexp-alist.

> ("\\`\x00\x00\xFE\xFF" . utf-32-be)
> ("\\`\xFF\xFE\x00\x00" . utf-32-le)

Emacs doesn't support those encoding for the momemnt.

---
Kenichi Handa
handa@m17n.org

  reply	other threads:[~2006-02-28  1:08 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-21  8:00 coding tags and utf-16 Werner LEMBERG
2005-12-23 23:43 ` Werner LEMBERG
2005-12-24 16:32   ` Richard M. Stallman
2006-01-04  6:42 ` Kenichi Handa
2006-01-04 14:58   ` Werner LEMBERG
2006-01-05  3:46   ` Richard M. Stallman
2006-01-05  4:33     ` Kenichi Handa
2006-01-05 12:24       ` David Kastrup
2006-01-06  0:27         ` Andreas Schwab
2006-01-05 23:11       ` Richard M. Stallman
2006-01-06  1:22         ` Werner LEMBERG
2006-01-06 11:26         ` Kenichi Handa
2006-01-07  4:23           ` Richard M. Stallman
2006-01-07  6:05             ` Kenichi Handa
2006-01-05 15:56   ` Stefan Monnier
2006-01-06  6:31     ` Kenichi Handa
2006-01-06 10:28       ` David Kastrup
2006-02-09  0:32         ` Kevin Rodgers
2006-02-28  1:08           ` Kenichi Handa [this message]
2006-03-04 20:34             ` Benjamin Riefenstahl
2006-03-06 13:04               ` Kenichi Handa
2006-03-06 19:35                 ` Benjamin Riefenstahl
2006-03-07  1:02                   ` Kenichi Handa
2006-03-08  5:42               ` Tomas Zerolo
2006-03-16  2:23             ` Kenichi Handa

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=E1FDtLw-0005XV-00@etlken \
    --to=handa@m17n.org \
    --cc=emacs-devel@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.