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:
@@ -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
|
||||
|
Reference in New Issue
Block a user