Currently, I'm using 3 types of characters in UTF-8 encoding: latin,
cyrillic and japanese's kanji/kana. latin and cyrillic works perfect,
but japanese's symbols renders as squares (see attachment). How to fix
it? Lately, I have used Vim on Linux and there was no problems with
japanese, so, I think it's mostly Windows issue. Can someone help me to
fix it?
Vim configuration:
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
...
set gfn=Courier_New:h12:cDEFAULT
set enc=utf-8
set fenc=utf-8
set tenc=utf-8
LANG variable:
en_US.UTF-8
On Thu, 04 Sep 2008 11:35:23 +0400, AlannY dixit:
> Currently, I'm using 3 types of characters in UTF-8 encoding: latin,
> cyrillic and japanese's kanji/kana. latin and cyrillic works perfect,
> but japanese's symbols renders as squares (see attachment). How to
> fix it? Lately, I have used Vim on Linux and there was no problems
> with japanese, so, I think it's mostly Windows issue. Can someone
> help me to fix it?
>
> Vim configuration:
[...]
> set gfn=Courier_New:h12:cDEFAULT
The most probable cause is that this font doesn't contain kanji/kana
characters. Under GTK2, if a glyph is not found in the current font,
Pango tries to get the glyph from a "similar" font. Under Windows you
will have to use a font which contains the glyphs you need. I don't know
which Windows fonts contains kanji/kana. You can use a specialized font
for kanji and kana, like Kochi Mincho, but western characters look VERY
ugly with those fonts...
Hope this helps.
Raúl "DervishD" Núñez de Arenas Coronado
--
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!
We are waiting for 13 Feb 2009 23:31:30 +0000 ...
I guess you need to set gfw to display cjk characters, I use
set gfw=DFSongStd:h10:cDEFAULT
you may use mincho or ms-gothic font.
--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
MS-Gothic works ;-) Problem solved ;-)
set gfw=MS_ゴシック:h12:cDEFAULT
I suppose Courier New doesn't include kanji/kana glyphs. On Windows
(also on GTK and a few others), you can choose your gvim font via a
menu, by means of
:set guifont=*
Once you've found a font which you like, you can set it in your vimrc; I
recommend replacing the "c" part by cDEFAULT.
When I was on Windows, I used MingLiU for kanji, but it is a Chinese
(Traditional) font, not a Japanese font. The Chinese (Traditional) hanzi
are more similar to the Japanese kanji than to the Chinese (Simplified)
hanzi, but there are some specific characters in each of them -- I
think, but I'm not sure, that that font includes all of them. I also
think, but I'm not sure, that it includes glyphs for the specifically
Japanese katakana and hiragana. Of course, it is possible (and even
probable) that for any given character, the shape of the brush strokes
will be more typical of China than of Japan; this ought not to make any
character unrecognizable though.
See also http://vim.wikia.com/wiki/Setting_the_font_in_the_GUI
Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
161. You get up before the sun rises to check your e-mail, and you
find yourself in the very same chair long after the sun has set.
You may want to have a look at my _vimrc, available at
http://wyw.dcweb.cn/download.asp?path=vim&file=_vimrc.html
It has the following autosettings for Windows:
* If a file is encoded in CP923, CP936, CP950, etc., the correct CJK
fonts will be used automatically
* <F8> can be used to switch between the CJK font and the Western font
* The default CJK font is guessed by the system encoding if it is CJK
* You may set a CJK font on l. 381 if you system encoding is Western;
in this case guifontwide will be set by the script
Best regards,
Yongwei
--
Wu Yongwei
URL: http://wyw.dcweb.cn/