1
0
forked from aniani/vim

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)
This commit is contained in:
Bram Moolenaar
2014-03-12 19:24:37 +01:00
parent af6c131bf7
commit b1692e2b8f
5 changed files with 71 additions and 12 deletions

View File

@@ -797,4 +797,29 @@ acp_to_enc(str, str_size, out, outlen)
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