I noted that all latin1 files are displayed as utf8 in gvim, but they
are latin1.
I decided now to set "latin1" as global encoding  and to create a
script
to check if a latin1 file has utf8 (latin1 non printable) characters.

This is my script:

function! s:NonPrintable()
        silent! exe "setlocal enc=utf8"
        if search('[^\x00-\xff]') != ""
            silent! exe matchadd('Error', '[^\x00-\xff]')
            silent! exe "setlocal enc=latin1"
            echo 'Non printable characters in text'
       else
            silent! exe "setlocal enc=latin1"
            echo 'All ok'
       endif
endfunction

The script doesn't give the echo command in the commandline.
What did I wrong?

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

Reply via email to