>
>
> On Sun, Jul 18, 2010 at 3:08 AM, Ted <cecinemapasderange@gmail.com
> <mailto:cecinemapasderange@gmail.com>> wrote:
>
> Thanks for that guidance, that does fix the problems, also for eg
> `vim.current.range.append(u'\u2026'.encode('utf-8')`. It's sort of
> inconvenient to have to do this though, is there no way to set the
> default encoding that will be used when sending text from Python to
> vim? If there is no way to do this with the Python-Vim interface,
> then perhaps that is something that should be worked into a higher-
> level vim module for Python. Does such a thing exist?
>
>
> Until now, i have not seen such things, maybe the vim python interface
> should be given some improvement. :-)
>
>
> I'm also wondering why there is a need to set the encoding in a Vim
> variable as you've done. As I understand it (perhaps not so well...),
> Vim always works with utf-8 natively, even under Windows.
>
>
> I am not very clear about the relationship between vim internal encoding
> and python unicode string.
> When i use the unicode directly in vim, something incorrect always comes
> out. So i found an alternate way as i said.
> And it is OK now without any problem although it is not very convenient.
>
> The vim internal encoding is set by "encoding" global variable as i know.
> If you not set that, gvim "maybe" use the "utf8" as default, but i am
> very sure about this.
> And if you set the encoding to "utf16", the vim should use the "utf16"
> as internal encoding when it read in a file, as i understand.
On Windows, Vim uses by default whatever encoding is set by your locale;
but you can change it. If your locale sets UTF-16le, Vim will represent
the data as UTF-8 in internal memory (because UTF-16 is not usable for
null-byte-terminated C strings) but the default for new files will
(IIUC) be UTF-16le. Note that when no -le or -be qualifier is used, Vim
assumes big-endian for UCS-2, UTF-16 and UTF-32 (aka UCS-4).
On Unix, gvim with GTK2 GUI uses UTF-8 when in GUI mode. I "think" that
Console Vim and non-GTK2 gvim follow your locale like in Windows but I'm
not sure (my locale, or to be precise, my $LC_CTYPE defaulting to $LANG,
is set to en_US.UTF-8).
>
>
> Cheers
> -Ted
Best regards,
Tony.
--
Fortune's Real-Life Courtroom Quote #19:
Q: Doctor, how many autopsies have you performed on dead people?
A: All my autopsies have been performed on dead people.
--
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
No comments:
Post a Comment