real implementation for IsValidCodePage
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5211 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
6133677dba
commit
8e1b521859
3 changed files with 15 additions and 8 deletions
|
@ -528,6 +528,20 @@ int MultiByteToWideChar(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr,
|
|||
return cchWideChar - (outbytes / sizeof (WCHAR));
|
||||
}
|
||||
|
||||
BOOL IsValidCodePage(UINT CodePage)
|
||||
{
|
||||
char cp[128];
|
||||
create_code_page_string(cp, sizeof(cp), CodePage);
|
||||
|
||||
iconv_t cd = iconv_open("UCS-2LE", cp);
|
||||
if (cd == (iconv_t) -1)
|
||||
return FALSE;
|
||||
|
||||
iconv_close(cd);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#define MY_ERROR_MSG(x) {if (g_display_errors) {fprintf(g_output,"%s", x);}}
|
||||
|
||||
char *my_convert(const char *path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue