Sunday, May 22, 2011

Re: what's a "conversion error" and how do I correct it?

Hi eNG1Ne!

On So, 22 Mai 2011, eNG1Ne wrote:

> Working on a Linux box (Ubuntu 10.4), I've successfully copy/pasted a
> block of text from a Planmaker spreadsheet into a vim file. The text
> includes U+2012 dashes, which are correctly displayed in vim … but
> when I try to save the vim file, I get the message "conversion error".

I guess, your fileencodings setting (notice the plural) does not include
utf-8, so Vim does not try to save it with that encoding. It probably
either tries to save it using plain old ASCII encoding or something like
latin1, which does not include this char and therefore conversion fails.

You should fix your 'fencs' setting to something like
ucs-bom,utf-8,default,latin1 or you can force Vim to save it in utf-8
encoding, by issuing :w ++enc=utf8 filename. (It might be, that this
needs the +multi_byte feature, which is only enabled, when compiling at
least a big version of Vim).

> Probably related, but when I used :dig to try and find the code for
> the U+2012 dash (so I could use search/replace) I couldn't spot one.
> Just out of curiosity, what do the numbers in the digraph reference
> page refer to?

The decimal number for that unicode char.

regards,
Christian

--
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:

Post a Comment