Message from discussion
Unicode conversion bug?
Received: by 10.114.95.1 with SMTP id s1mr6507293wab.13.1205379536754;
Wed, 12 Mar 2008 20:38:56 -0700 (PDT)
Return-Path: <antoine.mechely...@gmail.com>
Received: from mailrelay011.isp.belgacom.be (mailrelay011.isp.belgacom.be [195.238.6.178])
by mx.google.com with ESMTP id v36si14368812wah.3.2008.03.12.20.38.56;
Wed, 12 Mar 2008 20:38:56 -0700 (PDT)
Received-SPF: neutral (google.com: 195.238.6.178 is neither permitted nor denied by domain of antoine.mechely...@gmail.com) client-ip=195.238.6.178;
Authentication-Results: mx.google.com; spf=neutral (google.com: 195.238.6.178 is neither permitted nor denied by domain of antoine.mechely...@gmail.com) smtp.mail=antoine.mechely...@gmail.com
X-Belgacom-Dynamic: yes
Received: from 205.195-65-87.adsl-dyn.isp.belgacom.be (HELO [87.65.195.205]) ([87.65.195.205])
by relay.skynet.be with ESMTP; 13 Mar 2008 04:38:55 +0100
Message-ID: <47D8A215.4020504@gmail.com>
Date: Thu, 13 Mar 2008 04:40:05 +0100
From: Tony Mechelynck <antoine.mechely...@gmail.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b5pre) Gecko/2008031104 SeaMonkey/2.0a1pre
MIME-Version: 1.0
To: vim_multibyte@googlegroups.com
Subject: Re: Unicode conversion bug?
References: <672e42ee-97d1-4979-83b4-402f2e30cbc0@e23g2000prf.googlegroups.com> <47D78E76.2040408@gmail.com> <47D79E02.4040402@hkstar.com> <47D7A455.9020905@gmail.com> <47D8943B.5080409@hkstar.com>
In-Reply-To: <47D8943B.5080409@hkstar.com>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
Mansing wrote:
> The instruction works! Seems I must set both "enc" and "fenc" correctly
> ~before~ loading an input file.
>
> I used to set only the "enc" to match input file format before loading,
> and then the "fenc" to match the desired output file format before
> saving --everything looked fine until you reopen the output file!
>
> Thank you!
> mt 2008-03-13
'enc' means how Vim represents the data in memory. 'fenc' means how the
data is represented on disk, it will usually be set automagically at
load-time depending on 'fencs' (plural) which defines the heuristics
used by Vim to determine which encoding the file is in. If you want to
edit one particular file whose 'fileencoding' (singular) cannot be
properly detected by the 'fileencodings' (plural), then you will have to
use ++enc=<something> in the ":edit" command itself, as shown under
":help ++opt".
You don't have to change 'enc' as long as it contains glyphs for all the
characters in the file. For instance, gvim with GTK2 GUI normally
represents its data in UTF-8 internally, and since that Unicode encoding
can represent anything, if your gvim (like mine) is for GTK2 (which
usually means X11, which usually means Unix-like) you never need to
change the 'enc' setting. Similarly, in any +multi_byte version of gvim,
if you've set 'enc' to UTF-8 at the start of your vimrc, you can leave
it so forever and never change it, because this way, any 'fileencoding'
will be "representable" in memory.
You may change the 'fenc' of a loaded file, if you want to _change_ its
disk representation. That's why whenever you do it, the file acquires
'modified' status. You will then usually want to save your file under a
different name (using ":saveas") so you'll have both versions (in both
encodings) on your disk under different names and/or in different folders.
Best regards,
Tony.
--
When more and more people are thrown out of work, unemployment
results.
-- Calvin Coolidge