-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 18-Sep-06, at 3:24 PM, Yakov Lerner wrote:

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 :)
{snippage}
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 ?

Nope.  With my original test file
the output looks reasonable, but it shows
 CONVERSION ERROR in line 391
at the bottom of the screen.

I then tried the Japanese version
/Applications/iTunes.app/Contents/Resources/Japanese.lproj/ Localizable.strings
and got a similar CONVERSION ERROR message, and lots of question marks.
If I start vi, and do
:set encoding=utf16
:set fileencoding=utf16
then reopen the file, I get what looks *to me* like Japanese characters (I'm pretty much unilingual unfortunately)

Brian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFDvf/GnOmb9xIQHQRAupWAJwOGYCxwJjUn1oMzcOaFqVggzBo2QCg4IJt
yQS7zG/rRCnsonFu1qvcCks=
=2NJG
-----END PGP SIGNATURE-----

Reply via email to