*multibyte.txt*    For Vim version 5.4l.  Last change: 1999 May 08


		  VIM REFERENCE MANUAL    by Bram Moolenaar


Multi-byte support				*multibyte* *multi-byte*

This is limited information on the support in Vim to edit files that use more
than one byte per character.

See |+multi_byte| and |'fileencoding'|.

1. XIM and X fontset support		|xim|
2. UTF-8 in XFree86 xterm		|UTF8-xterm|

==============================================================================
1. XIM (X Input Method) and X fontset support.		*xim* *x-input-method*
							*xfontset* *x-fontset*

-. NOTE
   You can use multi-byte using gui VIM. This feature fully uses
   |+multi_byte|.

-. You should run X Input server which supports your language.
   You can see your language though you have no X Input server.

-. If needed, insert next 3 lines in your $HOME/.Xdefaults

	*international: True
	*.inputMethod: your_input_server_name
	*.preeditType: your_input_method

   Next 2 or 3 lines should be inserted in your $HOME/.Xdefaults:
   If you want to use multi-byte language, you should set 'guifontset'.

	Vim.font: english_font,your_language_font
	Vim*fontSet: english_font,your_language_font
	Vim*fontList: your_language_font:


   *international may not necessary if you use X11R6.
   *.inputMethod and *.preeditType is a optional if you use X11R6.

   your_input_method = OnTheSpot or OverTheSpot or OffTheSpot or Root
                       (OnTheSpot currently not supported).
   Vim.font is for text area.
   Vim*fontSet is for menu.
   Vim*fontList is for menu (Motif) <-- Athena version not needed.

   You should set 'guifontset' to use multi-byte. Example:

>	:set guifontset=english_font,your_language_font

   You can also specify font set as XLFD if it can be displayed your
   locale dependence codeset. e.g.

>       :set guifontset=-misc-fixed-medium-r-normal-*

   note) You can not use IM as long as you specify 'guifontset'
         Therefore,latain users, you have to also use 'guifontset'
	 if you use IM.

   And you should not set 'guifont'. If it is set, VIM ignores 'guifontset'.
   It means VIM runs without fontset supporting. So, you can see only
   english. Your language displays corrupted.

   After 'fontset' feature is enabled, VIM does not allow using 'font'.
   For example, if you use
      :set guifontset=eng_font,your_font
   in your .gvimrc, then you should do for syntax
      :hi Comment guifg=Cyan font=another_eng_font,another_your_font
   If you just do
      :hi Comment font=another_eng_font
   then you can see a GOOD error message. Be careful!

-. if needed, you can set XMODIFIERS env. var.

	sh:  export XMODIFIERS="@im=your_input_server_name"
	csh: setenv XMODIFIERS "@im=your_input_server_name"

   input_server_name is your XIM server name.

-. You should set LANG environment variable to your language.
   Don't unset or set to C.
	sh:  export LANG=ko
	csh: setenv LANG ko

-. In your .vimrc, add this
	set fileencoding=korea
   You can change the 'korea' to the some other name such as japan, taiwan.

-. BUGS & TODO
   *. your_language_font width should be twice than english_font width.
      I want to think it is not a bug. GVIM needs fixed width font.
      ex)  Vim.font: -*-fixed-*--14-*-*-*-*-70-*,-*-*-*-*--14-*-*-*-*-140-*
   *. If input method set fails, there should not be shown the additional
      status line in the bottom. Also, if user use Root style.
   *. Sometimes, gvim hangs if I press some button in the XIM server.
   *. In the visual mode, select with mouse, sometimes, only half of the
      characters are shown.
   *. And many other unknown side effect and BUG!!!!.

-. Compile
	./configure --with-x --enable-multibyte --enable-fontset --enable-xim
	make
	run_your_X_input_server_if_not_currently_running
	./vim -g

   note) If you use Linux, you should add '-DX_LOCALE' to the CFLAGS.
   note) If your system has broken-locale, such as current Linux for multibyte
	 people, you should add '--enable-broken-locale' to configure option.

Thanks to Bram who made a VIM, the best editor I have met.
Thanks to YJSeo who made a X Input Server, named hanIM.

Send any other comments, patches and suggestions to:

                                      Chi-Deok Hwang <cdhwang@sr.hei.co.kr>
                                      Sung-Hyun Nam <namsh@lgic.co.kr>
				      K.Nagano <nagano@atese.advantest.co.jp>

==============================================================================
2. UTF-8 in XFree86 xterm				*UTF8-xterm*

This is a short explanation of how to use UTF-8 character encoding in the
xterm that comes with XFree86 by Thomas Dickey (text by Markus Kuhn).

Get the latest xterm version which has now UTF-8 support:
> 
	http://www.clark.net/pub/dickey/xterm/xterm.tar.gz

Compile it with "./configure --enable-wide-chars ; make"

Also get the ISO 10646-1 version of the 6x13 font, which is available on

	http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz

and install the font as described in the README file.

Now start xterm with

>  xterm -u8 -fn -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1

and you will have a working UTF-8 terminal emulator. Try both

>  cat utf-8-demo.txt
>  vim utf-8-demo.txt

with the demo text that comes with ucs-fonts.tar.gz in order to see
whether there are any problems with UTF-8 in your xterm.

