vim conversion error

Archived topics about LMDE 1 and LMDE 2
Locked
n4rky

vim conversion error

Post by n4rky »

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!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
phlux

Re: vim conversion error

Post by phlux »

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?
n4rky

Re: vim conversion error

Post by n4rky »

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!
Locked

Return to “LMDE Archive”