" By default XML files are in UTF-8
let encoding = "UTF-8"
endif
+ call SetupEncoding(encoding)
endif
- call SetupEncoding(encoding)
endif
setlocal matchpairs+=<:> " Add brokets to the list of pairs that match for the '%' command
function! SetupEncoding(encoding)
- if !has("iconv") || exists('b:encoding_set')
+ if !has("iconv") || exists('b:encoding_set') || strlen(a:encoding) <= 0
return
endif
- if strlen(a:encoding) > 0
- call RestorePosition()
- let b:encoding_set = 1
- execute "edit ++enc=" . a:encoding
- endif
+ call RestorePosition()
+ let b:encoding_set = 1
+ execute "edit ++enc=" . a:encoding
endfunction