Saturday, January 22, 2011

Re: cp1252 characters when enc=utf-8, fenc=cp1252

On Jan 22, 9:43 am, sergio <mail...@sergio.spb.ru> wrote:
> On 01/21/2011 09:37 PM, Ben Fritz wrote:
>
> When fileencoding and encoding are different, vim converts file content from
> fileencoding to encoding on read and vice versa on write. So you
> actually work
> with utf8 characters. If you want to work with cp1251, you need to change
> encoding

I somehow have the impression that changing encoding while Vim was
already up and running is a bad idea. I don't really know *what* it
could mess up. Anyone?

>
> But characters like n-dash in text files is bad idea. It's better to use
> '&ndash;' or '--' or something like this, that will be translated later to
> n-dash. May be it will be better to convert all files to utf8. Also, if you
> need just enter characters like n-dash, you can use level3 in xkb.
>

Maybe in HTML files it makes sense to use &ndash;. But in a simple
text file there will not be any translating later. The particular file
I was working with when I noticed this is a file I use for keeping
track of my current tasks and notes, nobody else sees it, and it's all
in plaintext (with a little spice from the txtfmt plugin).

I work in Windows XP mostly, I actually have never heard of "xkb" and
don't have the slightest idea what it's level 3 is. Converting to
UTF-8 for this particular file would be OK but doesn't serve much
purpose, and most of the files I work with are latin1 and need to stay
that way.

As for entering the character, it looks like there is a digraph pre-
defined: -N for en dash, -M for em dash.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: