Skip to content

Commit 73407c6

Browse files
committed
Write batchfile to current codepage
1 parent c86659e commit 73407c6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plug.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,13 +357,14 @@ if s:is_win
357357
endfunction
358358

359359
" Copied from fzf
360+
let s:codepage = libcallnr('kernel32.dll', 'GetACP', 0)
360361
function! s:wrap_cmds(cmds)
361362
return map([
362363
\ '@echo off',
363364
\ 'setlocal enabledelayedexpansion']
364365
\ + (type(a:cmds) == type([]) ? a:cmds : [a:cmds])
365366
\ + ['endlocal'],
366-
\ 'v:val."\r"')
367+
\ printf('iconv(v:val."\r", "%s", "cp%d")', &encoding, s:codepage))
367368
endfunction
368369

369370
function! s:batchfile(cmd)

0 commit comments

Comments
 (0)