On Wed, May 30, 2007 at 04:16:57PM +0200, Damir Zucic wrote: > In the past I have used <ctrl-v><decimal_number> to insert special > characters (there are five uppercase and five lowercase exotic characters in > Croatian language). A single byte was used to store each of these characters. > > However, in version 7 two bytes are used to store each of them!
This is not due to the vim version, Vim 6 is capable of handling Unicode well too. Unicode just was not set up to be the default on your old system. > I don't know > how to fix this problem. The value of LANG variable is en_US.UTF-8 So for start, set up your locale environment properly. en_US.UTF-8 is English with UTF-8 encoding (that is Unicode) which is definitely different from Croatian with ISO 8859-2. If you prefer English messages and number formats, etc., as I do, set at least LC_CTYPE to fix the character set. > Decimal values of these exotic > characters are 200, 232, 198, 230, 208, 240, 169, 186, 174 and 190. Note such sentence is generally meaningless unless you specify the encoding (I suppose it's ISO 8859-2 as you mention it below). > The command :digraphs works fine and lists digraphs using iso-8859-1, I guess. Digraphs are not encoding dependent. Or they are encoding dependent, depending on how you look at it. The point is that digraphs insert the corresponding character in the current encoding, they do not insert a fixed byte or sequence of bytes. Now you use UTF-8, so they insert the characters in UTF-8 (they are generally *defined* using Unicode codepoints though). > The command :set encoding shows that encoding is utf-8 . > Normally, we use the code page ISO-8859-2 here in Croatia. > > What can I do to force vim to use a single byte to store exotic character? To set the encoding of edited files to ISO 8895-2, do set fileencoding=iso-8859-2 But I may suggest something, go with times and use UTF-8, at least for new files. 8bit charsets are so last millenium... If you set set fileencodings=utf-8,iso-8859-2 you will be able to edit both UTF-8 and ISO 8895-2 files. Yeti -- http://gwyddion.net/