help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reading binary, non-unix file


From: Kevin Rodgers
Subject: Re: reading binary, non-unix file
Date: Mon, 25 Oct 2004 17:55:32 -0600
User-agent: Mozilla Thunderbird 0.8 (X11/20040916)

[Please don't top-post.]

Mickey Ferguson wrote:
> We're almost there.  I don't have a single UTF-16 coding choice.  When I
> tried what you provided, I saw:
>
> Possible completions are:
> utf-16-be                          utf-16-be-dos
> utf-16-be-mac                      utf-16-be-unix
> utf-16-le                          utf-16-le-dos
> utf-16-le-mac                      utf-16-le-unix
>
> I chose utf-16-le and it seemed to do it properly.  I just don't know if
> that was the right choice - I don't fully understand what each of these
> provides.

LE = Little Endian and BE = Big Endian.  Emacs should provide an
encoding in which the endianness is determined from the BOM, but since
it doesn't, utf-16-le is right for x86 processors.  See
http://en.wikipedia.org/wiki/UTF-16

> Second, after I determine which one of the above to use, can anyone help me > to write a function so that I can then map a key combination (similar to C-X > C-F uses Find-File), that will load in the proper coding and then find the > file? I'm lisp-impaired, so any help would be appreciated. I'm capable of
> taking an interactive function that's been defined and mapping it to a
> keystroke, but that's about it.

What's wrong with `C-x RET c utf-16-le RET C-x C-f' :-)

If all the files are UTF-16 on your system, perhaps you can just put
this in your .emacs file:

(setq-default buffer-file-coding-system 'utf-16-le)

--
Kevin Rodgers


reply via email to

[Prev in Thread] Current Thread [Next in Thread]