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: Mickey Ferguson
Subject: Re: reading binary, non-unix file
Date: Mon, 25 Oct 2004 10:48:52 -0700

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.

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.

"Mathias Dahl" <address@hidden> wrote in message
news:address@hidden
> "Mickey Ferguson" <address@hidden> writes:
>
> Can you paste some part of the file here? My guess is that
> what you are looking at in emacs is a UTF-16 encoded file.
>
> I am not sure at all, but I know that when I export stuff
> from the registry to a file and just drag and drop that into
> emacs it displays a lots of "^@" (ASCII 0, Ctrl-0) between
> each "real" character. This is because it is UTF-16 encoded.
>
> If I guess correctly you should be able to do this:
>
> C-x <return> c u t f - 1 6 <return> C-x C-f m y _ f i l e . t x t <return>
>
> where my_file.txt is the file you want to look at, and Emacs
> will parse the file as it should.
>
> /Mathias





reply via email to

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