unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Werner LEMBERG <wl@gnu.org>
Subject: Re: coding tags and utf-16
Date: Sat, 24 Dec 2005 00:43:29 +0100 (CET)	[thread overview]
Message-ID: <20051224.004329.71165760.wl@gnu.org> (raw)
In-Reply-To: <20051221.090033.182620434.wl@gnu.org>

> There is a serious problem with coding tags and utf-16 encodings of
> any flavour: Emacs simply can't recognize the tag.  [...]


Surprisingly, I saw no response on the list which either means that my
mail hasn't come through, nobody is interested in this problem, or
that it is a non-issue.

In case it won't get fixed I suggest to add it to the TODO list,
together with a not in the emacs manual that coding tags don't work
with utf-16 encoding flavours.


    Werner


> This is a non-trivial problem.  Right now I'm working on a groff
> preprocessor which tries to handle this.  I'm doing the following to
> find the tag in an encoding-independent way:
> 
>   . Check whether the file starts with the BOM (Byte Order Mark) --
>     this is one of the following byte sequences:
> 
>       UTF-8:  0xEFBBBF
>       UTF-16: 0xFEFF or 0xFFFE
> 
>     Skip it.
> 
>   . Ignore zero bytes while looking for the -*- coding: ... -*-
>     stuff.
> 
> This heuristic algorithm might not give correct results in all cases
> but it should be sufficiently reliable for normal use.

  reply	other threads:[~2005-12-23 23:43 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 [this message]
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
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=20051224.004329.71165760.wl@gnu.org \
    --to=wl@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 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).