[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: coding tags and utf-16
From: |
David Kastrup |
Subject: |
Re: coding tags and utf-16 |
Date: |
Fri, 06 Jan 2006 11:28:45 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Kenichi Handa <address@hidden> writes:
> In article <address@hidden>, Stefan Monnier <address@hidden> 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
- Re: coding tags and utf-16, (continued)
- Re: coding tags and utf-16, Kenichi Handa, 2006/01/04
- Re: coding tags and utf-16, Richard M. Stallman, 2006/01/05
- Re: coding tags and utf-16, Werner LEMBERG, 2006/01/05
- Re: coding tags and utf-16, Kenichi Handa, 2006/01/06
- Re: coding tags and utf-16, Richard M. Stallman, 2006/01/06
- Re: coding tags and utf-16, Kenichi Handa, 2006/01/07
Re: coding tags and utf-16, Stefan Monnier, 2006/01/05