Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

29 lines
574 B

//
// misc.c
//
#include "private.h"
#include "immif.h"
#pragma warning(disable: 4005)
#include <wingdip.h>
BYTE GetCharsetFromLangId(LCID lcid)
{
CHARSETINFO csInfo;
if (!TranslateCharsetInfo((DWORD *)(ULONG_PTR)lcid, &csInfo, TCI_SRCLOCALE))
return DEFAULT_CHARSET;
return (BYTE) csInfo.ciCharset;
}
UINT GetCodePageFromLangId(LCID lcid)
{
TCHAR buf[8]; // maxmum may be six
if (GetLocaleInfo(lcid, LOCALE_IDEFAULTANSICODEPAGE, buf, ARRAYSIZE(buf))) {
return _ttoi(buf);
}
return CP_ACP;
}