From e21b001116d5eb0b4ec799d73c11277d14a1ca61 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 7 Jan 2020 02:11:47 -0500 Subject: [PATCH] [vim] Use iconv only if +iconv is enabled (#1813) --- plugin/fzf.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 0bbeaff9..21b7d66b 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -49,8 +49,13 @@ if s:is_win " Use utf-8 for fzf.vim commands " Return array of shell commands for cmd.exe - let s:codepage = libcallnr('kernel32.dll', 'GetACP', 0) function! s:enc_to_cp(str) + if !has('iconv') + return a:str + endif + if !exists('s:codepage') + let s:codepage = libcallnr('kernel32.dll', 'GetACP', 0) + endif return iconv(a:str, &encoding, 'cp'.s:codepage) endfunction function! s:wrap_cmds(cmds)