Multibyte Encoding Support in Nvi

Nvi is a BSD-licensed re-implementation of the original vi editor, and it is frozen at version 1.79. This project creates a nvi fork with sufficient multibyte encoding support.


We consider the following multibyte encodings:

  1. Single byte character sets, either ASCII (7-bit) or 8-bit extended encodings, e.g., ISO8859-1, KOI8-R;
  2. Non-Unicode two bytes character sets, mainly CJK families, e.g., GBK, SJIS;
  3. Unicode families. UTF-8 and UTF-16.

Some other requirements:

  1. The encoding settings can be changed through ex commands at the runtime. By default, the input encoding obeys the locale.
  2. It features some form of file encoding detection.
  3. It behaviors in the original nvi-1.79 (the version presents in the FreeBSD base system and mostly confirms with the POSIX standard) way.
  4. The whole software is clearly BSD licensed.


  1. Merge with nvi-devel-1.81.6, gain iconv/ncursesw related code, broken DB1 code, 'fileencoding' and 'inputencoding' options, :vsplit. Nvi-1.79's screen structure, file/DB structure, event model, and editing/search/subst behaviors are kept.
  2. Fix DB1 code with iconv support. old file structure new file structure

  3. Drop Perl, Tcl, gtags support.
  4. Merge/update manpage, catalog.
  5. File encoding detection (based on file(1)) and RFC docs.
  6. Support UTF-16 with hacks on DB/iconv, and the file write procedure.
  7. Restore Xterm title with xprop ('windowname' option).
  8. Port nvi-1.81.6's modified regex to support wide char.
  9. make buildworld WARNS=1 clear.


Homepage: Testing:

ZhihaoSoC2011 (last edited 2020-10-24T22:43:09+0000 by SashaVigole)