Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VIM unable to find iconv dll in windows (+iconv/dyn option) #440

Closed
louarr opened this issue Oct 7, 2015 · 10 comments
Closed

VIM unable to find iconv dll in windows (+iconv/dyn option) #440

louarr opened this issue Oct 7, 2015 · 10 comments

Comments

@louarr
Copy link

louarr commented Oct 7, 2015

The latest iconv dll from gnuwin32 is named libiconv2.dll. Should vim also try to load this dll instead of the old libiconv.dll? For the time being I was able to solve the problem by copying libiconv2.dll to libiconv.dll.

@vim-ml
Copy link

vim-ml commented Oct 7, 2015

On Wed, Oct 7, 2015 at 2:06 AM, louarr vim-dev-github@256bit.org wrote:

The latest iconv dll from gnuwin32 is named libiconv2.dll. Should vim also
try to load this dll instead of the old libiconv.dll? For the time being I
was able to solve the problem by copying libiconv2.dll to libiconv.dll

Vim on Windows (when compiled with +iconv/dyn) will look for either
iconv.dll or libiconv.dll (see :help iconv-dynamic). IIRC libiconv.dll is
considered to be the better of the two. If your libiconv2.dll is backward
compatible with libiconv.dll (has the same entry points and call
conventions and such) it should work.

Best regards,
Tony.

@louarr
Copy link
Author

louarr commented Oct 7, 2015

Yes it works fine. I just want to point out that users with newer windows machines will most probably download the gnuwin32 version of libiconv (libiconv2.dll) and find that vim will fail to convert their file encoding (euc-jp in my case).

@mattn
Copy link
Member

mattn commented Oct 8, 2015

dll names are hard-coded in mbyte.c. but it seems that there are more names. for example msys2 provide libiconv-2.dll not libiconv2.dll.

@louarr louarr closed this as completed Oct 10, 2015
@brammool
Copy link
Contributor

Yasuhiro Matsumoto wrote:

dll names are hard-coded in mbyte.c. but it seems that there are more
names. for example msys2 provide libiconv-2.dll not libiconv2.dll.

Well, it's not too difficult to look for those two as well.

Due knot trussed yore spell chequer two fined awl miss steaks.

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \
\ an exciting new programming language -- http://www.Zimbu.org ///
\ help me help AIDS victims -- http://ICCF-Holland.org ///

@mattn
Copy link
Member

mattn commented Oct 12, 2015

@brammool But -2 will be changed if the version of libtool will be changed.

@k-takata
Copy link
Member

@mattn No, it will be changed when libiconv changes its API and if compatibility is lost. Not when libtool is changed.

@mattn
Copy link
Member

mattn commented Oct 12, 2015

Ah, I did missunderstand. @brammool so it' possible to add libiconv-2.dll.

@vim-ml
Copy link

vim-ml commented Oct 12, 2015

On Monday, October 12, 2015 at 10:52:27 AM UTC+9, K.Takata wrote:

@mattn No, it will be changed when libiconv changes its API and if compatibility is lost. Not when libtool is changed.


Reply to this email directly or view it on GitHub.

Bram, below is a patch.

diff --git a/src/mbyte.c b/src/mbyte.c
index 75559b0..7351b67 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -4400,7 +4400,8 @@ static HINSTANCE hMsvcrtDLL = 0;

ifndef DYNAMIC_ICONV_DLL

define DYNAMIC_ICONV_DLL "iconv.dll"

-# define DYNAMIC_ICONV_DLL_ALT "libiconv.dll"
+# define DYNAMIC_ICONV_DLL_ALT1 "libiconv.dll"
+# define DYNAMIC_ICONV_DLL_ALT2 "libiconv-2.dll"

endif

ifndef DYNAMIC_MSVCRT_DLL

define DYNAMIC_MSVCRT_DLL "msvcrt.dll"

@@ -4458,7 +4459,9 @@ iconv_enabled(verbose)
return TRUE;
hIconvDLL = vimLoadLib(DYNAMIC_ICONV_DLL);
if (hIconvDLL == 0) /* sometimes it's called libiconv.dll */

  • hIconvDLL = vimLoadLib(DYNAMIC_ICONV_DLL_ALT);
  • hIconvDLL = vimLoadLib(DYNAMIC_ICONV_DLL_ALT1);
  • if (hIconvDLL == 0) /* sometimes it's called libiconv-2.dll */
  • hIconvDLL = vimLoadLib(DYNAMIC_ICONV_DLL_ALT2);
    if (hIconvDLL != 0)
    hMsvcrtDLL = vimLoadLib(DYNAMIC_MSVCRT_DLL);
    if (hIconvDLL == 0 || hMsvcrtDLL == 0)

@chrisbra
Copy link
Member

@vim-ml
Copy link

vim-ml commented Oct 13, 2015

Yasuhiro Matsumoto wrote:

On Monday, October 12, 2015 at 10:52:27 AM UTC+9, K.Takata wrote:

@mattn No, it will be changed when libiconv changes its API and if compatibility is lost. Not when libtool is changed.


Reply to this email directly or view it on GitHub.

Bram, below is a patch.

Thanks. I'll also check for libiconv2.dll, which is what was mentioned
in the original report.

hundred-and-one symptoms of being an internet addict:
33. You name your children Eudora, Mozilla and Dotcom.

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \
\ an exciting new programming language -- http://www.Zimbu.org ///
\ help me help AIDS victims -- http://ICCF-Holland.org ///

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants