Wednesday, April 8, 2015

Odp: How to convert plain text from code page Windows 1250 to code page ISO 8859-2?

Dnia Środa, 8 Kwietnia 2015 17:31 Igor Forca <igor2x@gmail.com> napisał(a)
> VIM 7.4 ON UBUNTU 14.04
>
> 1. Open Vim with command:
> vim
>
> 2. Set internal Vim encoding to UTF-8:
> :set encoding=utf-8
>
> 3. Open file that is encoded using Windows 1250 code page:
> :e ++enc=cp1250 test.txt
> Note: In status bar there is message: [converted]
>
> 4. Change file encoding to ISO 8859-2 code page:
> :set fileencoding=iso-8859-2
>
> 5. Save the file and actually do the code page conversion:
> :w
> Note: In status bar there is message: [converted] written
>
> Above steps works perfectly without a problem. But this is on Vim for Ubuntu.
>
>
> Now a problem.
>
>
> gVIM 7.4 ON WINDOWS 7
>
> All steps the same as above. But at step 5 when I try to save a file I get an error:
> "test.txt" E213: Cannot convert (add! to write without conversion).
> See print-screen of error message: https://i.imgur.com/ZuVRpOK.png
> See print-screen of gVim for Windows version: https://i.imgur.com/uWNE8ce.png
>
> Any idea what is wrong on my Vim for Windows?
>

Maybe you have some characters which cannot be converted? In such case Vim will decline to convert file. You have to find offending characters and remove them. Also I've got better success rate with operations:

1. Open normally file (if it is in native MS encoding)
2. w! ++enc=iso-8859-2

m.




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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: