[prev in list] [next in list] [prev in thread] [next in thread] 

List:       netbsd-tech-userlevel
Subject:    Re: vi: invalid conversion, truncated file
From:       mlelstv () serpens ! de (Michael van Elst)
Date:       2010-05-18 19:10:26
Message-ID: hsuon1$dis$1 () serpens ! de
[Download RAW message or body]

adam.hoka@gmail.com (Adam Hoka) writes:

>On Tue, 18 May 2010 12:11:17 +0200
>Ignatios Souvatzis <is@netbsd.org> wrote:

>> On Sat, May 15, 2010 at 12:39:04PM +0200, Thomas Klausner wrote:
>> > Hi!
>> > 
>> > When opening a file in vi in a UTF-8 environment, doing changes and
>> > saving-and-quitting, I sometimes open files that are not valid UTF-8
>> > files (e.g. iso-8859-1).
>> > 
>> > vi then claims "invalid conversion" and truncates the file at the
>> > first invalid character.
>> 
>> Does this happen at reading or writing?
>> 
>> 	-is

>I saw that too, it happens on :w...


The error happens when reading. If it is in a part of the file
you are editing, you see then the error then and nothing bad happens.

But if it is in a part of the file you didn't touch, it happens when
:w reads the remainder of the file. That's where the data gets
destroyed.

-- 
-- 
                                Michael van Elst
Internet: mlelstv@serpens.de
                                "A potential Snark may lurk in every tree."
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic