Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Sep 2015 12:45:09 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 203040] Nvi truncates files with non-ASCII characters
Message-ID:  <bug-203040-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203040

            Bug ID: 203040
           Summary: Nvi truncates files with non-ASCII characters
           Product: Base System
           Version: 10.2-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: bjornr@iceland2000.com

Created attachment 160929
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=160929&action=edit
ISO-8859 file containing ;ð;; string, which Nvi will not load

Nvi 2.1.2 (from FreeBSD 10.0 to FreeBSD 10.2) displays this behaviour in our
system, when a certain character composition appears in a file - the file will
be truncated from that line, with a false EOF placed in the line, making the
file unusable.

A file with non-ASCII characters (like eth) can be created to verify the
problem:
;ð;;

(the file should be ISO8859, the login.conf has lang, charset and lc_all set to
iso-8859-1, added to default:
        :charset=ISO8859-1:\
        :lang=is_IS.ISO8859-1:\
        :lc_all=is_IS.ISO8859-1: \
The client terminal is set to ISO or Western-1252).

A file, which contains only
;ð;
will not be truncated.

After saving and re-opening the file, the fileencoding will be set to utf-8, by
Nvi.

vi will display file with multiple lines like after re-opening:
line 1
line 2
line 3
~
line 5

line 4 was ;ð;; when the file was created, and after re-opening the file
content after ~ is unusable. Other strings like ð ; will also break. Not all
non-ASCII characters will do this, ý will be ok, but á will not... (y acute, a
acute)

Replacing vi with Nvi 1.79 from FreeBSD 9 does alleviate the problem.

By unsetting login.conf to defaults, a file can be created, saved and
re-opened, but it will not display the characters correctly, it will look like:
;\xf0;;
instead of
;ð;;

Setting LANG will again break Nvi with the message:
Conversion error on line 1; FILE: unmodified: line 1

I've described the problem to Sven Verdoolaege also.

Currently being very careful, or installing Nvi 1.79 from FreeBSD 9.3 source
tree.

-- 
You are receiving this mail because:
You are the assignee for the bug.


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-203040-8>