unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: Re: coding tags and utf-16
Date: Fri, 06 Jan 2006 11:28:45 +0100	[thread overview]
Message-ID: <85vewxodk2.fsf@lola.goethe.zz> (raw)
In-Reply-To: <E1Eul7v-00056E-00@etlken> (Kenichi Handa's message of "Fri, 06 Jan 2006 15:31:03 +0900")

Kenichi Handa <handa@m17n.org> writes:

> In article <m1psn61xim.fsf-monnier+emacs@gnu.org>, Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>>>  So, in any cases, a tag value itself is useless.  Then how
>>>  to detect utf-16 more reliably?  In the current Emacs
>>>  (i.e. Ver.22), I think we can use auto-coding-regexp-alist
>>>  or auto-coding-alist.  In the former case, we can register
>>>  BOM patterns and also something like "\\`\\(\0[\0-\177]\\)+"
>>>  for utf-16be.  In the latter case, you can use more
>>>  complicated heuristics in a registered function.
>
>> Can't it be somehow added to detect_coding_utf_16?
>
> Yes, but usually it has no effect if, for instance,
> iso-8859-1 is more preferred.  If only ASCII and Latin-1
> characters are encoded in utf-16, all bytes (including BOM)
> are valid for iso-8859-1.

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.

Of course, for the BOM-less utf-16 encodings, priority should depend
on the language environment.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

  reply	other threads:[~2006-01-06 10:28 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 [this message]
2006-02-09  0:32         ` Kevin Rodgers
2006-02-28  1:08           ` Kenichi Handa
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=85vewxodk2.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).