vim conversion error

Questions about applications and software
Forum rules
Before you post please read this

vim conversion error

Postby n4rky on Fri Mar 01, 2013 6:19 pm

Hello,

I can't make this go away--and stay away.

I'm editing files with vim that include non-ASCII characters. Even if vim reads the file correctly, it REFUSES to write it correctly, insisting that it gets a conversion error and replacing quotation marks, apostrophes, characters with diacritical marks, etc., with diamonds containing question marks.

I have configured /etc/locale.gen and run locale-gen countless times. I have added the LANG environment variable to my startup environment and confirmed that it is properly set.

I need this killed. It's ridiculous to have this kind of problem in 2013.

Thanks!
n4rky
Level 1
Level 1
 
Posts: 7
Joined: Sat Aug 18, 2012 10:20 pm

Linux Mint is funded by ads and donations.
 

Re: vim conversion error

Postby phlux on Fri Mar 01, 2013 6:49 pm

Have you tried issuing
Code: Select all
:e ++enc=utf-8
before writing or altering?

This is, of course, assuming you're messing with some utf-8 chars. If not, what encoding are you trying to edit?
Image
User avatar
phlux
Level 1
Level 1
 
Posts: 24
Joined: Wed Feb 27, 2013 9:49 am
Location: Houston, TX

Re: vim conversion error

Postby n4rky on Fri Mar 01, 2013 7:41 pm

Hi,

Now, just as mysteriously, I'm unable to reproduce the problem. Not nice. This might be because I added a cron job to run locale-gen hourly (maybe it takes more than one execution?), but then this would require an explanation for why I was able to edit correctly using TECO (an old editor I remember from DEC PDP-11 days and in a few ways still prefer) after vim failed.

I've created a .vimrc with the command you suggest. It complains if I just run vim without a file specification, but it's exceedingly rare that I do that.

Thanks!
n4rky
Level 1
Level 1
 
Posts: 7
Joined: Sat Aug 18, 2012 10:20 pm


Return to Software & Applications

Who is online

Users browsing this forum: No registered users and 9 guests