Thanks so much, it does seem like I'm having a font problem. When I changed gfn=Courier_New:h12 I was able to properly see hebrew text, but if I opened the japanese translation I have the same problem as before. This is not to say that I speak japanese, but I was just wondering if there was a way for vim to autodetect a suitable font dependent on the unicode characters present in the file. Is there a universal font by any chance? (that would be too easy right). Also if I'm using the command line version of vim, will gui_font still work or do I need to set another option?
On 8/13/06, A.J.Mechelynck <[EMAIL PROTECTED]> wrote:
Daniel Dadush wrote: > Hi, I'm trying to do some work in i18n and I've having trouble getting > vim to properly display text in different languages. I'm currently > working with the MoinMoin wiki, looking at it's translatable text > strings (which are in 18 different languages) and almost all of them > render with strange characters on the screen. I set both file-encoding > and encoding to utf-8 and still no luck. If I open this files in IDLE > (the python editor) all the text displays perfectly, so I'm pretty > sure I have all the right language packs installed (I think...). Does > anyone know what I'm doing wrong? Any suggestions would be highly > appreciated. > > Vim Version: 7.0 > OS: WinXP SP2 > > Oops. To have Vim display file data properly, you need the following: 1) a version of gvim with +multi_byte compiled-in: ":echo has("multi_byte") should return 1 2) a font which contains the proper glyphs. This can be set by means of the 'guifont' option, whose acceptable values vary between versions of the GUI. Here's an example of how to set it "portably" in your vimrc: if has("gui_running") if has("gui_gtk2") set gfn=Adobe\ Courier\ 12 elseif has("gui_kde") set gfn=Adobe\ Courier/12 elseif has("x11") " also for GTK+1 set gfn=*-courier-medium-r-normal-*-*-160-*-*-m-*-* else " Windows, non-X11 Mac, etc. set gfn=Courier_New:h12 endif endif 3) gvim must know in which charset the file was written. Method 1: Automatic recognition. The following will recognise any Unicode file if it has a BOM, UTF-8 files even without a BOM, and default the rest to Latin1. It will, however, open 7-bit US-ASCII files as UTF-8 because 7-bit ASCII data is valid UTF-8: :set fileencodings=ucs-bom,utf-8,latin1 3bis) Method 2: Manual recognition. If you have a file in a strange charset, you can tell Vim which 'fileencoding' to use: :edit ++enc=ko18-r russkij_tekst.txt Best regards, Tony.