I'm not sure.
- IIUC, typing
echo Здравствуйте мир!
at the cmd.exe prompt works OK (echoes the correct Russian greeting in
reply) and the result can be pasted (but not into Vim)?
- Does it make a difference if you leave 'termencoding' empty?
- Are you sure your console uses cp866? The email I'm replying to was in
koi8-r.
Until (or unless) this issue is resolved, you ought to be able to use
gvim (with the same settings), where anything can be stored in memory
(as a UTF-8 bytestring) and displayed in the GUI in some well-chosen
font. (I recommend _not_ to use Lucida_Console because its Cyrillic bold
glyphs are a tiny wee bit wider than its unbold glyphs -- or used to be
when I was on XP; Courier_New should be OK even if less "pretty".) A
well-chosen 'fileencodings' setting and/or use of the ++enc modifier
(see ":help ++opt") in commands such as :e <filename>, :new <filename>,
:tabedit <filename>, etc. should let you edit files in any Cyrillic
encoding such as koi8-r, koi8-u, ISO-8859-5, Windows-1251 or cp866 -- as
well, of course, as in Unicode encodings such as UTF-8. (It might not be
possible to get _automatic_ recognition of all Cyrillic encodings but
you can always _tell_ gvim which 'fileencoding' to use, e.g. by means of
:e ++enc=cp866 russtext.txt
)
Best regards,
Tony.
--
A new dramatist of the absurd
Has a voice that will shortly be heard.
I learn from my spies
He's about to devise
An unprintable three-letter word.
IIUC, the Vim default for 'termencoding' is the empty string. Maybe that
option is set elsewhere, maybe in the UTF-8-setting script that I
published at vim-online, or maybe in some other script. What does
Console Vim answer to
:verbose set enc? tenc?
immediately after startup (the way you normally start it, with vimrc and
all)?
To know what console encoding yout WinXP uses, start Vim as
vim -N -u NONE
(which loads neither your vimrc nor any global plugins), then, after
startup, ask
:set enc?
That should show you the "default encoding" used by the underlying terminal.
Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
143. You dream in pallettes or 256 colors.
Oho! Sounds like a missing screen redraw somewhere. You aren't using
'lazyredraw' by any chance? Also, what Vim version and patchlevel are
you using? (as shown on the second non-blank line of the ":intro"
screen, or as the first two lines -- starting "VIM - Vi Improved" and
"Included patches" respectively -- in the output of ":version")
Or rather -- Vim is probably not aware that the font has been changed
(see bottom paragraph before my sig below) so it doesn't redraw anything.
What happens if you hit Ctrl-L (in Normal mode) between steps 4 and 5?
My guess would be that the text from step 2 turns to crap, which might
indicate that your bitmapped font has wrong glyphs for your current
terminal encoding. I expect that the Russian would reappear after step
6, even where it had changed to crap at step 4½.
>
> So the only option I can see for now is using Lucida Console.
Is that so bad? (in Console Vim, not gvim)
The font in Console Vim is in any case a function of the terminal -- Vim
has no action on it: it can neither determine what is in use nor change
it -- unless maybe by running the appropriate OS-dependent commands as
external programs, for instance via system()
Best regards,
Tony.
--
Albert Einstein, when asked to describe radio, replied: "You see, wire
telegraph is a kind of a very, very long cat. You pull his tail in New
York and his head is meowing in Los Angeles. Do you understand this?
And radio operates exactly the same way: you send signals here, they
receive them there. The only difference is that there is no cat."
> I am not 100% sure it is cp866 but I use WinXP. Is there a way I can
> check what encoding it uses?
In Console execute chcp and it should display the default value. Use
chcp <encoding> to change to any other encoding. I am not sure, if the
Windows console supports utf-8 though.
regards,
Christian
--
:wq!
If I knew Lucida console is okay for vim console I wouldn't email
here.
I don't know. Maybe setting the bitmapped font changes the terminal to a
different encoding, and Vim, if already running, would of course be
unaware of the change (it's only at startup that Vim "asks" the OS what
encoding it should use).
About the "triangles": IIRC, the glyph used in bitmapped fonts (such as
the PC ROM-BIOS cp437 font used in the text console before any other
font has been loaded) for the byte 0x7F is a kind of triangle, usually
with its two bottom corners slightly lopped off. However, in ASCII or in
most character sets based on ASCII, that byte is a "control character"
which is either represented as an "invalid character" (which could be
the Unicode "reverse-video question mark in a diamond" glyph, or the
"hollow triangle" glyph, or something meaning "unknown character" such
as ? or ¿) -- or even not displayed at all.
I should have gone to sleep yesterday evening (it's 11:37 my time now)
so you should expect a delay of several hours before I reply to the next
message iun this thread.
Best regards,
Tony.
--
Everybody is somebody else's weirdo.
-- Dykstra