What does [converted] mean at the bottom of vim

vivim

I have a log file, and when I open it via vim, it looks not readable, and it has [converted] at the bottom. What does [converted] mean?

Is there a way to fix the format issue so that it is human readable?

Best Answer

It means that vim detected that the file did not match the charset given by your locale and made a conversion. If you run the command :set from within vim:

:set
--- Options ---
  autoindent          fileformat=dos      scroll=7            textwidth=70
  background=dark     filetype=asciidoc   shiftwidth=2        ttyfast
  cscopetag           helplang=en         softtabstop=2       ttymouse=sgr
  cscopeverbose       hlsearch            syntax=asciidoc
noendofline           list                tabpagemax=3
  expandtab           ruler               textmode
  backspace=indent,eol,start
  comments=s1:/*,ex:*/,://,b:#,:%,:XCOMM,fb:-,fb:*,fb:+,fb:.,fb:>
  cscopeprg=/usr/bin/cscope
  fileencoding=utf-8
  fileencodings=ucs-bom,utf-8,latin1

Notice the last 2 options, fileencoding & fileencodings.

The first is the encoding used for the current file, the second is a comma separated list of recognized encodings.

So when you see that message vim is telling you that it's completed converting the file from fileencoding to encoding.

Check out :help fileencoding or :help encoding for additional details.

Reference

I found the thread below, which I used as a source when this was answered. The original site is now gone (accessible in this answer's history), so I'm moving the contents of that thread here for posterity sake. The link was still in the Wayback Machine.

#1 Eli the Bearded January 21st, 2004 - 06:51 pm ET | Report spam
In comp.os.linux.misc, Leon. wrote:
Hide the quote
"GaƩtan Martineau" wrote in message
news:E9jLb.2903$
> [ system_notes]$ vi installation_chouette.txt
> What means the [converted] at the bottom of the screen, as in:
> "installation_chouette.txt" [converted] 2576L, 113642C

It means that vim detected that the file did not match the
charset given by your locale and made a conversion. What does

:set

Tell you about "fileencoding" and "fileencodings"? The first is
the encoding used for the current file, the second is a comma
separated list of recognized encodings.

Hide the quote
> This file has accented characters. How can I save the file so that if I
> reload if again, I do not see "converted"?



Figure out what charset you want, and then

:set fileencoding=[charset]
:w

Hide the quote
It means deleting the Microsoft Dos/ Windows CR LF end of lines, to just
LF - unix standard end of lines.

It does not. If you open a file with DOS line ends, vim reports [dos]
after the filename, not [converted]. If you do have a dos file that
you wish to convert to unix line ends, you can

:set fileformat=unix
:w

Elijah
Related Question