Esto suena como lo que estás buscando. Este consejo de la vim
wiki titulado: Obligar a UTF-8 Vim a leer Latin1 como Latin1 .
$ vim -c "e ++enc=latin1" file.txt
También desde vim
's :help
puedes hacer esto para ver más sobre codificaciones.
:help enc
extracto de :help enc
'encoding' 'enc' string (default: "latin1" or value from $LANG)
global
{only available when compiled with the +multi_byte
feature}
{not in Vi}
Sets the character encoding used inside Vim. It applies to text in
the buffers, registers, Strings in expressions, text stored in the
viminfo file, etc. It sets the kind of characters which Vim can work
with. See encoding-names for the possible values.
NOTE: Changing this option will not change the encoding of the
existing text in Vim. It may cause non-ASCII text to become invalid.
It should normally be kept at its default value, or set when Vim
starts up. See multibyte. To reload the menus see :menutrans.
This option cannot be set from a modeline. It would most likely
corrupt the text.
NOTE: For GTK+ 2 it is highly recommended to set 'encoding' to
"utf-8". Although care has been taken to allow different values of
'encoding', "utf-8" is the natural choice for the environment and
avoids unnecessary conversion overhead. "utf-8" has not been made
the default to prevent different behavior of the GUI and terminal
versions, and to avoid changing the encoding of newly created files
without your knowledge (in case 'fileencodings' is empty).
...
...
-b
, eso solo establecerá algunas otras opciones, vea:help edit-binary
. No veo una diferencia en cómo se muestran los bytes no imprimibles (por lo general, muestra NUL sin-b
). Principalmente no estoy usando-b
, porque uso estas opciones para verificar codificaciones extrañas en archivos de texto.