OpenSolaris

Printable Version Enter a New Search
Bug ID 6687328
Synopsis vim can't set encoding correctly
State 10-Fix Delivered (Fix available in build)
Category:Subcategory utility:vim
Keywords
Responsible Engineer Petr Sumbera
Reported Against snv_79 , snv_102 , snv_104
Duplicate Of
Introduced In
Commit to Fix snv_108
Fixed In snv_108
Release Fixed solaris_nevada(snv_108)
Related Bugs 6638947 , 6729892 , 6784607
Submit Date 11-April-2008
Last Update Date 12-February-2009
Description
vim can't display multibyte characters such as Japanse/Chinese/Korean.
SPARC version works fine.
When you say that SPARC works fine, I assume that it doesn't work for you on x86?
Is there a difference between Nevada and Indiana?  What locale are you running in?
Do you have all the appropriate locale packages installed?
In snv_93 that full locale pkgs are installed, vim (version 7.1.284) works fine on SPARC, but x86. This is reproducible in any UTF-8 locales on x86 while I just found
out it works fine in Asian EUC locales (eg, ja, ko, zh).
SPARC version may set encoding=utf-8 by default? If so, please set it for x86 as well.
According to the vim documentation (:help multibyte) the encoding should be set correctly on vim's start:

------------------------------------------
ENCODING

If your locale works properly, Vim will try to set the 'encoding' option
accordingly.
------------------------------------------

This is not the case with vim on Solaris Nevada. According to the sentence cited above either our locale is not working properly (I think it is not the case) or vim is not setting the encoding as it should do.

Steps to reproduce:
1. Set any UTF-8 locale, for example: sk_SK.UTF-8
2. Run vim.
3. Type ':set encoding' in the vim.
4. You will get '  encoding=latin1'. This is incorrect. According to the locale you should get 'encoding=utf-8'.
Work Around
Use /usr/has/bin/vi.
Create $HOME/.vimrc which contains the following line.
    set encoding=utf-8
Comments
N/A