[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: UTF-8 and changelog



Hi, Stephen Gran wrote:

> Just a quick question about encoding changelog in utf-8.  My normal
> locale is iso-8859-1 (en_US or so, I guess), and `file changelog`
> returns 'ASCII text'.

Note that "file" doesn't look at the whole file, so it may miss non-ASCII
characters if they're not at the beginning.

Personally, I use vim. I have the following line in my .vimrc:

	:set fileencodings=utf-8,latin1

In other words, use utf-8 if the file is well-formed utf-8, else use
Latin1. (The set of latin1-encoded files which are valid as UTF-8 is
empty, for all practical purposes.) This preserves the file's original
encoding.

Changing the encoding to utf-8 is as simple as typing
	:set fileencoding=utf-8
before saving. (note the singular.)

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
-- 
"Burn the libraries, for their value is in this one book (the Koran)."
       [Omar I, 2nd Caliph, at the capture of Alexandria]



Reply to: