Saturday, September 9, 2017

Re: Encoding issues with Windows gvim

On Sat, Sep 9, 2017 at 8:08 PM, Joseph L. Casale <jcasale@gmail.com> wrote:
> I have a utf-16-le based file with a bom which I can view on a linux host with vi without issue:
>
> # file utf16.txt
> utf16.txt: Little-endian UTF-16 Unicode text, with CRLF line terminators
>
> # od -t x1 -N 2 utf16.txt
> 0000000 ff fe
> 0000002
>
> It opens and appears as expected with vi at the console (see vim_linux.png).
>
> However on Windows when I reload it with :e ++ff=dos ++enc=utf-16le it displays as the attached gvim_windows.png. No incantation of settings I can come up allow me to open and edit this on Windows.
>
> Anyone have an idea how to accomplish this?
>
> Thanks.

In your Windows gvim, at the point where you would be reading your
problematic file, do instead

:verbose set enc?

If the answer is anything other than utf-8, then you cannot display
the file in gvim because the UTF-16le of the file cannot be translated
into whatever it is that gvim is using to represent characters in
memory.

See http://vim.wikia.com/wiki/Working_with_Unicode

Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: