From owner-freebsd-questions@freebsd.org Thu Apr 4 19:06:54 2019 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38D22155403C for ; Thu, 4 Apr 2019 19:06:54 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from smh-06.1blu.de (smh-06.1blu.de [178.254.0.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E76A2882B3 for ; Thu, 4 Apr 2019 19:06:52 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from [172.16.29.5] (helo=sh4-5.1blu.de) by smh-06.1blu.de with esmtp (Exim 4.86_2) (envelope-from ) id 1hC7hD-0002yA-5N for freebsd-questions@freebsd.org; Thu, 04 Apr 2019 21:06:43 +0200 Received: from ftp51246-2575596 by sh4-5.1blu.de with local (Exim 4.86_2) (envelope-from ) id 1hC7hD-0002el-1q for freebsd-questions@freebsd.org; Thu, 04 Apr 2019 21:06:43 +0200 Date: Thu, 4 Apr 2019 21:06:43 +0200 From: Matthias Apitz To: freebsd-questions@freebsd.org Subject: Re: vi(1) and ISO 8859-1 Message-ID: <20190404190642.GA4609@sh4-5.1blu.de> Reply-To: Matthias Apitz Mail-Followup-To: freebsd-questions@freebsd.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Operating-System: FreeBSD 12.0-CURRENT r314251 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. User-Agent: Mutt/1.5.24 (2015-08-30) X-Rspamd-Queue-Id: E76A2882B3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[guru@unixarea.de]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[unixarea.de]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-1.40)[ipnet: 178.254.0.0/19(-3.89), asn: 42730(-3.11), country: DE(-0.01)]; MX_GOOD(-0.01)[mail.unixarea.de]; NEURAL_HAM_SHORT(-0.44)[-0.438,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:42730, ipnet:178.254.0.0/19, country:DE]; RCVD_TLS_LAST(0.00)[] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2019 19:06:54 -0000 El día Thursday, April 04, 2019 a las 07:14:49PM +0200, Rocky Hotas escribió: > Hello! > I have an ISO-8859-1 text file, which is opened and shared by several OSs. > If I open it with vi(1) in FreeBSD 12.0, its encoding is not detected and > UTF-8 is used, instead. Any non-ascii character will be read and written > incorrectly in UTF-8, creating an ambiguous encoding. Are you sure that the file is completely ISO-8859-1 encoded? What does file(1) says about and what happens if you run it through iconv(1) translating from ISO-8859-1 to UTF-8 into /dev/null, will iconv(1) do it or complain? matthias -- 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 !