vmware-archive / salt-vim

Vim files for editing Salt files
Other
248 stars 73 forks source link

UTF-8 warning for salt problems #24

Open Reiner030 opened 10 years ago

Reiner030 commented 10 years ago

Hello,

The function is very nice. But would'nt it be better to set then the default behavior that vim didn't save them in the wrong format?

like here: http://automatthias.wordpress.com/2006/07/18/vim-utf-8-and-iso-8859-2/

I have added in ~/.vim/ftplugin/sls.vim:

setlocal fileencoding=latin1

and now it looks nice in the file:

# file telescope/init.sls
telescope/init.sls: ASCII text, with very long lines
# vi telescope/init.sls 
< adding umlauts  äöüß>
# file telescope/init.sls
telescope/init.sls: ISO-8859 text, with very long lines

There is only still the red warning in the interface because editing is done in UTF-8 locale which can then be removed ?

basepi commented 9 years ago

Not sure if this is the right fix....vim saves it as the correct type for me.

before:

something.sls: ASCII text

after adding umlauts äöüß:

something.sls: UTF-8 Unicode text

UTF-8 should be expected, right? I may be misunderstanding.

Reiner030 commented 9 years ago

no thats the problem... Salt refuses to work on UTF8 files :(

basepi commented 9 years ago

I thought we had fixed the majority of the UTF-8 problems... =\

Reiner030 commented 9 years ago

ok, thats by setting this option then explicit to true? https://docs.saltstack.com/en/latest/ref/configuration/master.html#yaml-utf8

basepi commented 9 years ago

Honestly I'm not sure of all the details, I wasn't closely involved in the fixes. But I wasn't aware of that config option, you might not even need it. Have you tested in a 2015.5 version of salt to see if you're still hitting UTF8 problems?