File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed
autoload/vital/__vital__/System Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -16,18 +16,39 @@ function! s:_vital_depends() abort
1616 return []
1717endfunction
1818
19+ if s: is_windows
20+ " iconv() wrapper for safety.
21+ function ! s: iconv (expr , from, to ) abort
22+ if a: from == # ' ' || a: to == # ' ' || a: from == ? a: to
23+ return a: expr
24+ endif
25+ let result = iconv (a: expr , a: from , a: to )
26+ return result !=# ' ' ? result : a: expr
27+ endfunction
28+ endif
29+
1930if ! s: is_nvim
2031 " inner callbacks for Vim
2132 function ! s: inner_out_cb (user_out_cb, ch , msg) abort
22- call a: user_out_cb (a: msg )
33+ let result = a: msg
34+ if s: is_windows
35+ let result = s: iconv (a: msg , ' char' , &encoding )
36+ endif
37+
38+ call a: user_out_cb (result)
2339 endfunction
2440
2541 function ! s: inner_exit_cb (user_exit_cb, job, exit_code) abort
2642 call a: user_exit_cb (a: exit_code )
2743 endfunction
2844
2945 function ! s: inner_err_cb (user_err_cb, ch , msg) abort
30- call a: user_err_cb (a: msg )
46+ let result = a: msg
47+ if s: is_windows
48+ let result = s: iconv (a: msg , ' char' , &encoding )
49+ endif
50+
51+ call a: user_err_cb (result)
3152 endfunction
3253else
3354 " inner callbacks for Neovim
You can’t perform that action at this time.
0 commit comments