Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Apr 2019 07:18:35 +0200
From:      Matthias Apitz <guru@unixarea.de>
To:        freebsd-questions@freebsd.org
Subject:   Re: vi(1) and ISO 8859-1
Message-ID:  <20190405051835.GA18093@sh4-5.1blu.de>
In-Reply-To: <trinity-377d302a-8822-473a-b563-ce9cc7238ad5-1554415164891@3c-app-mailcom-lxa08>
References:  <trinity-f25766ad-e745-4e70-98d1-52c0ba83fe56-1554398089214@3c-app-mailcom-lxa05> <20190404190642.GA4609@sh4-5.1blu.de> <trinity-377d302a-8822-473a-b563-ce9cc7238ad5-1554415164891@3c-app-mailcom-lxa08>

next in thread | previous in thread | raw e-mail | index | archive | help
El día Thursday, April 04, 2019 a las 11:59:24PM +0200, Rocky Hotas escribió:

> It completes successfully, exit status is 0. You can easily create such a
> file and reproduce this: just open vi(1), set the encoding with
> `:se fe=iso-8859-1', and just type a letter with an accent, like:

I have to use ':set fileencoding=iso-88591' and with that I produced the
file file-iso-8859-1.txt as:

$ cat file-iso-8859-1.txt
¡Viva la Revolución!

$ od -c file-iso-8859-1.txt
0000000  241   V   i   v   a       l   a       R   e   v   o   l   u   c
0000020    i 363   n   !  \n                                            
0000025

As you see, the non ASCII chars are coded in ISO.

I reloaded it with 'vim file-iso-8859-1.txt' without setting the
encoding, added some more chars and wrote it back as:

$ od -c file-iso-8859-1.txt
0000000  241   V   i   v   a       l   a       R   e   v   o   l   u   c
0000020    i 363   n   !  \n 241   V   i   v   a       l   a       R   e
0000040    v   o   l   u   c   i 363   n   !  \n                  
0000052

and all was fine.

This is with vim 8.1.555 on 

$ uname -a
FreeBSD c720-r342378 13.0-CURRENT FreeBSD 13.0-CURRENT GENERIC  amd64

-- 
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
70 years of NATO - 70 years of wars (Jugoslavia, Afghanistan, Syria, ...) and 70 years
of war preparation against Russia.  -- PEACE instead of NATO !



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