updated for version 7.4.202
Problem: MS-Windows: non-ASCII font names don't work.
Solution: Convert between the current code page and 'encoding'. (Ken Takata)
diff --git a/src/winclip.c b/src/winclip.c
index 0f110ff..f34c7d9 100644
--- a/src/winclip.c
+++ b/src/winclip.c
@@ -797,4 +797,29 @@
vim_free(widestr);
}
}
+
+/*
+ * Convert from 'encoding' to the active codepage.
+ * Input is "str[str_size]".
+ * The result is in allocated memory: "out[outlen]". With terminating NUL.
+ */
+ void
+enc_to_acp(str, str_size, out, outlen)
+ char_u *str;
+ int str_size;
+ char_u **out;
+ int *outlen;
+
+{
+ LPWSTR widestr;
+ int len = str_size;
+
+ widestr = (WCHAR *)enc_to_utf16(str, &len);
+ if (widestr != NULL)
+ {
+ WideCharToMultiByte_alloc(GetACP(), 0, widestr, len,
+ (LPSTR *)out, outlen, 0, 0);
+ vim_free(widestr);
+ }
+}
#endif