On 9/18/06, Brian McKee <[EMAIL PROTECTED]> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On 18-Sep-06, at 11:56 AM, David Morel wrote:

> Brian McKee a écrit :
>>>> file Localizable.strings
>>>> Localizable.strings: Big-endian UTF-16 Unicode C program
>>>> character data
>> If I open that file in vim I get
>> ??^@/[EMAIL PROTECTED]@ [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
PROTECTED]@ [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
PROTECTED]@[EMAIL PROTECTED]
>> but Text Edit displays it correctly.
>> Can vi handle this type of file?  If so, how?
> in vim, type :h multibyte
> that should get you started :)

Eeeek - started right around the bend I think :-)
Biggest issue from my current point of view is it studiously ignores
Mac OS...

Chris Eidhof suggested
> set encoding=utf8
> set fileencoding=utf8

which works if you set it before you open the file in question.
Interestingly =utf16 'works' too... or at least it shows plain ASCII
type lettering ok.

Between those ideas I've decided to leave things alone and just do a
    :e ++enc=utf16
whenever I see lots of alternating @ signs and letters :-)
I think I'd prefer leaving my standard encoding at latin1 to match
the linux
boxes I'm often working on at the same time.

Am I right in understanding that Apple's TextEdit must be automatically
detecting UTF16 files and changing it's base encoding to match?

And is there some way that vi could do the same?

The folowing autodetects utf-16 from latin1
for me I put it into my ~/.vimrc:

  au BufRead * if getline(1) =~ "\n" | e ++enc=utf16 | endi

... Does it following work for you ?

Yakov

Reply via email to