• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetLocaleInfo函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetLocaleInfo函数的典型用法代码示例。如果您正苦于以下问题:C++ GetLocaleInfo函数的具体用法?C++ GetLocaleInfo怎么用?C++ GetLocaleInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetLocaleInfo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: getFirstDayOfWeek

int getFirstDayOfWeek()
{
	// Let's make it's sunday by default
	int result = 0;
	GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IFIRSTDAYOFWEEK, (LPWSTR)&result, 2);

	// GetLocaleInfo returns numeric char '0' - '6'
	// Hence, just subtracting...
	result -= '0';

	return result;
}
开发者ID:pgurenko,项目名称:ConsoleCalend,代码行数:12,代码来源:calend.cpp


示例2: measurementSystem

QVariant QSystemLocalePrivate::measurementSystem()
{
    wchar_t output[2];

    if (GetLocaleInfo(lcid, LOCALE_IMEASURE, output, 2)) {
        QString iMeasure = QString::fromWCharArray(output);
        if (iMeasure == QLatin1String("1")) {
            return QLocale::ImperialSystem;
        }
    }

    return QLocale::MetricSystem;
}
开发者ID:Afreeca,项目名称:qt,代码行数:13,代码来源:qlocale_win.cpp


示例3: DecimalPoint

TCHAR CLocale::DecimalPoint()
{
// TODO should really allow multiple character decimal point markers
// although I'm not sure if any languages use them.
	TCHAR Buf[10];
	if (GetLocaleInfo(m_LocaleID, LOCALE_SDECIMAL, Buf, sizeof(Buf)))
	{
		if (strlen(Buf) == 1)
			return (Buf[0]);
	}
	// default
	return (TCHAR('.'));
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:13,代码来源:Clocale.cpp


示例4: IsTime24

BOOL IsTime24()
{
	DWORD dwTime24 = 0;
	wchar_t wsTime24[10] = L"1";
	if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ITIME, wsTime24, 10))
	{
		if (wcsicmp(wsTime24, L"0") == 0)
			dwTime24 = 0;
		else if (wcsicmp(wsTime24, L"1") == 0)
			dwTime24 = 1;
	}
	return dwTime24 ? TRUE : FALSE;
}
开发者ID:ultrashot,项目名称:clockhub-native,代码行数:13,代码来源:Utils.cpp


示例5: DisplayPackInfo

static void DisplayPackInfo(HWND hwndDlg, const LANGPACK_INFO *pack)
{
	/* locale string */
	if (!(pack->flags & LPF_NOLOCALE)) {
		TCHAR szLocaleName[256], szLanguageName[128], szContryName[128];

		if (!GetLocaleInfo(pack->Locale, WINVER >= _WIN32_WINNT_WIN7 ? LOCALE_SENGLISHLANGUAGENAME : LOCALE_SENGLANGUAGE, szLanguageName, _countof(szLanguageName)))
			szLanguageName[0] = _T('\0');
		if (!GetLocaleInfo(pack->Locale, WINVER >= _WIN32_WINNT_WIN7 ? LOCALE_SENGLISHCOUNTRYNAME : LOCALE_SENGCOUNTRY, szContryName, _countof(szContryName)))
			szContryName[0] = _T('\0');
		
		/* add some note if its incompatible */
		if (szLanguageName[0] && szContryName[0]) {
			mir_sntprintf(szLocaleName, _T("%s (%s)"), TranslateTS(szLanguageName), TranslateTS(szContryName));
			if (!IsValidLocale(pack->Locale, LCID_INSTALLED)) {
				TCHAR *pszIncompat;
				pszIncompat = TranslateT("(incompatible)");
				szLocaleName[_countof(szLocaleName) - mir_tstrlen(pszIncompat) - 1] = 0;
				mir_tstrcat(mir_tstrcat(szLocaleName, _T(" ")), pszIncompat);
			}
			SetDlgItemText(hwndDlg, IDC_LANGLOCALE, szLocaleName);
		}
		else SetDlgItemText(hwndDlg, IDC_LANGLOCALE, TranslateT("Unknown"));
	}
	else SetDlgItemText(hwndDlg, IDC_LANGLOCALE, TranslateT("Unknown"));
	
	/* file date */
	SYSTEMTIME stFileDate;
	TCHAR szDate[128]; szDate[0] = 0;
	if (FileTimeToSystemTime(&pack->ftFileDate, &stFileDate))
		GetDateFormat(Langpack_GetDefaultLocale(), DATE_SHORTDATE, &stFileDate, NULL, szDate, _countof(szDate));
	SetDlgItemText(hwndDlg, IDC_LANGDATE, szDate);
	
	/* general */
	SetDlgItemText_CP(hwndDlg, IDC_LANGMODUSING, pack->szLastModifiedUsing);
	SetDlgItemText_CP(hwndDlg, IDC_LANGAUTHORS, pack->szAuthors);
	SetDlgItemText_CP(hwndDlg, IDC_LANGEMAIL, pack->szAuthorEmail);
	SetDlgItemText(hwndDlg, IDC_LANGINFOFRAME, TranslateTS(pack->tszLanguage));
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:39,代码来源:lpopts.cpp


示例6: _imp_getProcessLocale

void _imp_getProcessLocale( rtl_Locale ** ppLocale )
{
    WCHAR langCode[ELP_LANGUAGE_FIELD_LENGTH];
    WCHAR ctryCode[ELP_COUNTRY_FIELD_LENGTH];
    LCID  localeId;

    OSL_ASSERT( ppLocale );

    /* get the LCID to retrieve information from */
    localeId = GetUserDefaultLCID();

    /* call GetLocaleInfo to retrieve the iso codes */
    if( GetLocaleInfo( localeId, LOCALE_SISO639LANGNAME , langCode, ELP_LANGUAGE_FIELD_LENGTH )  &&
        GetLocaleInfo( localeId, LOCALE_SISO3166CTRYNAME , ctryCode, ELP_COUNTRY_FIELD_LENGTH ) )
    {
        *ppLocale = rtl_locale_register( langCode, ctryCode, L"" );
    }
    else
    {
        *ppLocale = rtl_locale_register( L"C", L"", L"" );
    }
}
开发者ID:CaoMomo,项目名称:core,代码行数:22,代码来源:nlsupport.c


示例7: test_codeset3

void test_codeset3()
{
    int   ret;
    CALID calid;
    DWORD value;
    LOCALESIGNATURE LocSig;

    value = 0;
    memset(&LocSig,0,sizeof(LOCALESIGNATURE));

    ret = GetLocaleInfo(LOCALE_USER_DEFAULT,
                    LOCALE_ICALENDARTYPE | LOCALE_RETURN_NUMBER,
                    (LPTSTR)&value,
                    sizeof(value) / sizeof(TCHAR) );
    if (ret) {
        printf("GetLocaleInfo:1: returned %ld ... value %lu\n", ret, value);
    } else {
        ret = GetLastError();
        printf("GetLocaleInfo:2: returned error %d... value %lu\n", ret, value );
    }

    calid = value;


    ret = GetLocaleInfo(LOCALE_USER_DEFAULT,
                    LOCALE_FONTSIGNATURE,
                    (LPTSTR)&LocSig,
                    sizeof(LocSig) / sizeof(TCHAR) );

    if (ret) {
        printf("GetLocaleInfo:2: returned %ld ...\n", ret);
        show_hexified( (char *)&LocSig, sizeof(LOCALESIGNATURE), 0 );

    } else {
        ret = GetLastError();
        printf("GetLocaleInfo:2: returned error %d... \n", ret );
    }
    
}
开发者ID:geoffmcl,项目名称:test-suite,代码行数:39,代码来源:test-codeset.c


示例8: InitShortDateCB

/* Init short date control box */
VOID
InitShortDateCB(HWND hwndDlg, LCID lcid)
{
    TCHAR szShortDateFmt[MAX_SAMPLES_STR_SIZE];
    INT nRetCode;

    /* Limit text lengths */
    SendMessage(GetDlgItem(hwndDlg, IDC_SHRTDATEFMT_COMBO),
                CB_LIMITTEXT,
                MAX_SHRTDATEFMT,
                0);
    SendMessage(GetDlgItem(hwndDlg, IDC_SHRTDATESEP_COMBO),
                CB_LIMITTEXT,
                MAX_SHRTDATESEP,
                0);

    /* Get current short date format */
    GetLocaleInfo(lcid,
                  LOCALE_SSHORTDATE,
                  szShortDateFmt,
                  MAX_SAMPLES_STR_SIZE);

    /* Clear all box content */
    SendMessage(GetDlgItem(hwndDlg, IDC_SHRTDATEFMT_COMBO),
                CB_RESETCONTENT,
                (WPARAM)0,
                (LPARAM)0);

    /* Enumerate short date formats */
    hwndEnum = GetDlgItem(hwndDlg, IDC_SHRTDATEFMT_COMBO);
    EnumDateFormats(ShortDateFormatEnumProc, lcid, DATE_SHORTDATE);

    /* Set current item to value from registry */
    nRetCode = SendMessage(GetDlgItem(hwndDlg, IDC_SHRTDATEFMT_COMBO),
                           CB_SELECTSTRING,
                           -1,
                           (LPARAM)szShortDateFmt);

    /* If it is not successful, add new value to list and select them */
    if (nRetCode == CB_ERR)
    {
        SendMessage(GetDlgItem(hwndDlg, IDC_SHRTDATEFMT_COMBO),
                    CB_ADDSTRING,
                    0,
                    (LPARAM)szShortDateFmt);
        SendMessage(GetDlgItem(hwndDlg, IDC_SHRTDATEFMT_COMBO),
                    CB_SELECTSTRING,
                    -1,
                    (LPARAM)szShortDateFmt);
    }
}
开发者ID:RareHare,项目名称:reactos,代码行数:52,代码来源:date.c


示例9: GetLocaleInfo

/********************************************
StringToNumber
	Purpose
		Converts a string to a number.
		This function will work with strings
		containing characters other than numbers,
		by removing non-digit characters before the
		conversion. Therefore it will work with 
		strings such as: "$123,456.00","123-456-789"
	Params
		string - string to convert
		number - resulting number
	Return
		UG_SUCCESS	success
		UG_ERROR	fail
*********************************************/
int CUGCell::StringToNumber(CString *string,double *number)
{
	CString tempString;
	tempString = *string;
	// remove localized thousand separators
	TCHAR szThousandSep[4];
	GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, szThousandSep, 4);
	tempString.Replace( szThousandSep, _T("") );
	// remove localized currency indicators
	TCHAR szCurrencyMark[6];
	GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SCURRENCY, szCurrencyMark, 6);
	tempString.Replace( szCurrencyMark, _T("") );
	// Replace the localized decimal separator with the standard, which is
	// understood by the _ttol function
	TCHAR szDecimalSep[4];
	GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, szDecimalSep, 4);
	tempString.Replace( szDecimalSep, _T(".") );

	// parse the string to its numeric value
	*number = ::_tcstod(tempString, NULL);

	return UG_SUCCESS;
}
开发者ID:fdiskcn,项目名称:LollyMFC,代码行数:39,代码来源:UGCell.cpp


示例10: srand

char *rndnickcountry(char *strbuf)
{
	char temp[10];

    srand(GetTickCount());

	GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SABBREVCTRYNAME, temp, sizeof(temp));
	_snprintf(strbuf, MAXNICKLEN, "%s|", temp);

    for (int i=0;i < maxrand;i++) 
		_snprintf(strbuf, MAXNICKLEN, "%s%i", strbuf, rand()%10);

	return (strbuf);
}
开发者ID:hazcod,项目名称:botnets,代码行数:14,代码来源:rndnick.cpp


示例11: Time_GetAMPMSize

void Time_GetAMPMSize (HDC hdc, SIZE *pSize, LPTSTR pszAM, LPTSTR pszPM)
{
   TCHAR szAM[ cchRESOURCE ];
   TCHAR szPM[ cchRESOURCE ];
   if (!pszAM)
      pszAM = szAM;
   if (!pszPM)
      pszPM = szPM;

   if (!GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_S1159, pszAM, cchRESOURCE))
      lstrcpy (pszAM, TEXT("AM"));

   if (!GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_S2359, pszPM, cchRESOURCE))
      lstrcpy (pszPM, TEXT("PM"));

   SIZE sAM; // size of "AM"
   GetTextExtentPoint (hdc, pszAM, lstrlen(pszAM), &sAM);

   SIZE sPM; // size of "PM"
   GetTextExtentPoint (hdc, pszPM, lstrlen(pszPM), &sPM);
   pSize->cx = max( sAM.cx, sPM.cx );
   pSize->cy = max( sAM.cy, sPM.cy );
}
开发者ID:maxendpoint,项目名称:openafs_cvs,代码行数:23,代码来源:ctl_time.cpp


示例12: SetLocale

BOOL CLocale::SetLocale(LCID LocaleID)
{
	TCHAR Buf[4];
	if (GetLocaleInfo(LocaleID, LOCALE_SABBREVLANGNAME, Buf, sizeof(Buf)))
	{
		TCHAR *LocName = _tsetlocale(LC_ALL, Buf);
		if (LocName)
		{
			m_csLocaleName = LocName;
			m_LocaleID = LocaleID;
		}
	}
	return (LocaleID == m_LocaleID);
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:14,代码来源:Clocale.cpp


示例13: defined

int MDateTimeHelper::hourMode()
{
    bool format12h = false;
#if defined(Q_OS_WIN)
    wchar_t data[10];
    GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STIMEFORMAT, data, 10);
    format12h = QString::fromWCharArray(data).startsWith(QLatin1Char('h'));
#elif defined(HAVE_MEEGOTOUCH)
    format12h = (MLocale().timeFormat24h() == MLocale::TwelveHourTimeFormat24h ? true :
                (MLocale().timeFormat24h() == MLocale::TwentyFourHourTimeFormat24h ? false :
                MLocale().defaultTimeFormat24h() == MLocale::TwelveHourTimeFormat24h));
#endif
    return format12h ? TwelveHours : TwentyFourHours;
}
开发者ID:dragly,项目名称:journey-planner-qml,代码行数:14,代码来源:mdatetimehelper.cpp


示例14: defined

int SDateTime::hourMode()
{
    bool format12h = false;
#if defined(Q_OS_WIN)
    wchar_t data[10];
    GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STIMEFORMAT, data, 10);
    format12h = QString::fromWCharArray(data).startsWith(QLatin1Char('h'));
#elif defined(Q_OS_SYMBIAN)
    TExtendedLocale loc;
    loc.LoadSystemSettings();
    format12h = loc.GetLocale()->TimeFormat() == ETime12;
#endif
    return format12h ? TwelveHours : TwentyFourHours;
}
开发者ID:9smart,项目名称:QQC_1_1_for_Symbian1,代码行数:14,代码来源:sdatetime.cpp


示例15: GetLocaleInfo

CString Util::GetMyDate(void)
{

	CString strDate;
	SYSTEMTIME time;

	int n = GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SSHORTDATE, 0, 0);

	if(n != 0){

		char *szFormat = new char[n];
		ZeroMemory(szFormat, n);

		n = GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SSHORTDATE, szFormat, n);

		GetLocalTime(&time);
		
		n = GetDateFormat(LOCALE_SYSTEM_DEFAULT, 0, &time, szFormat, 0, 0); 
		
		if(n != 0){

			char *szDate = new char[n];
			ZeroMemory(szDate, n);

			n = GetDateFormat(LOCALE_SYSTEM_DEFAULT, 0, &time, szFormat, szDate, n);
			
			strDate = szDate;
			
			delete szDate;
			szDate   = 0;
		}

		delete szFormat;
		szFormat = 0;
	}
	return strDate;
}
开发者ID:MXControl,项目名称:RoboMX,代码行数:37,代码来源:Util.cpp


示例16: LocalesEnumProc

static BOOL CALLBACK
LocalesEnumProc(LPTSTR lpLocale)
{
    LCID lcid;
    TCHAR lang[255];
    INT index;
    BOOL bNoShow = FALSE;

    lcid = _tcstoul(lpLocale, NULL, 16);

    /* Display only languages with installed support */
/*  See bug #4898.
    if (!IsValidLocale(lcid, LCID_INSTALLED))
        return TRUE;
*/

    if (lcid == MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH), SORT_DEFAULT) ||
        lcid == MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH_MODERN), SORT_DEFAULT))
    {
        if (bSpain == FALSE)
        {
            LoadString(hApplet, IDS_SPAIN, lang, 255);
            bSpain = TRUE;
        }
        else
        {
            bNoShow = TRUE;
        }
    }
    else
    {
        GetLocaleInfo(lcid, LOCALE_SLANGUAGE, lang, sizeof(lang)/sizeof(TCHAR));
    }

    if (bNoShow == FALSE)
    {
    index = SendMessage(hList,
                        CB_ADDSTRING,
                        0,
                        (LPARAM)lang);

    SendMessage(hList,
                CB_SETITEMDATA,
                index,
                (LPARAM)lcid);
    }

    return TRUE;
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:49,代码来源:generalp.c


示例17: VERIFY

void CWordPadApp::LoadOptions()
{
	BYTE* pb = NULL;
	UINT nLen = 0;

	HFONT hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
	if (hFont == NULL)
		hFont = (HFONT)GetStockObject(ANSI_VAR_FONT);
	VERIFY(::GetObject(hFont, sizeof(LOGFONT), &m_lf));

	m_bWordSel = GetProfileInt(szSection, szWordSel, TRUE);
	TCHAR buf[2];
	buf[0] = NULL;
	GetLocaleInfo(GetUserDefaultLCID(), LOCALE_IMEASURE, buf, 2);
	int nDefUnits = buf[0] == '1' ? 0 : 1;
	SetUnits(GetProfileInt(szSection, szUnits, nDefUnits));
	m_bMaximized = GetProfileInt(szSection, szMaximized, (int)FALSE);

	if (GetProfileBinary(szSection, szFrameRect, &pb, &nLen))
	{
		ASSERT(nLen == sizeof(CRect));
		memcpy(&m_rectInitialFrame, pb, sizeof(CRect));
		delete pb;
	}
	else
		m_rectInitialFrame.SetRect(0,0,0,0);

	CRect rectScreen(0, 0, GetSystemMetrics(SM_CXSCREEN),
		GetSystemMetrics(SM_CYSCREEN));
	CRect rectInt;
	rectInt.IntersectRect(&rectScreen, &m_rectInitialFrame);
	if (rectInt.Width() < 10 || rectInt.Height() < 10)
		m_rectInitialFrame.SetRect(0, 0, 0, 0);

	if (GetProfileBinary(szSection, szPageMargin, &pb, &nLen))
	{
		ASSERT(nLen == sizeof(CRect));
		memcpy(&m_rectPageMargin, pb, sizeof(CRect));
		delete pb;
	}
	else
		m_rectPageMargin.SetRect(1800, 1440, 1800, 1440);

	m_optionsText.LoadOptions(szTextSection);
	m_optionsRTF.LoadOptions(szRTFSection);
	m_optionsWord.LoadOptions(szWordSection);
	m_optionsWrite.LoadOptions(szWriteSection);
	m_optionsIP.LoadOptions(szIPSection);
}
开发者ID:jetlive,项目名称:skiaming,代码行数:49,代码来源:wordpad.cpp


示例18: EnumLocalesProc

// To get the names of the languages
BOOL CALLBACK EnumLocalesProc(LPTSTR lpLocaleString)
{
	TCHAR *stopped = NULL;
	USHORT langID = (USHORT) _tcstol(lpLocaleString, &stopped, 16);

	TCHAR ini[32];
	TCHAR end[32];
	GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SISO639LANGNAME, ini, MAX_REGS(ini));
	GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SISO3166CTRYNAME, end, MAX_REGS(end));

	TCHAR name[64];
	mir_sntprintf(name, MAX_REGS(name), _T("%s_%s"), ini, end);

	for(int i = 0; i < tmp_dicts->getCount(); i++)
	{
		Dictionary *dict = (*tmp_dicts)[i];
		if (lstrcmpi(dict->language, name) == 0)
		{
#define LOCALE_SLOCALIZEDLANGUAGENAME 0x0000006f
#define LOCALE_SNATIVEDISPLAYNAME 0x00000073
			
			GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SENGLANGUAGE, dict->english_name, MAX_REGS(dict->english_name));

			GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SLANGUAGE, dict->localized_name, MAX_REGS(dict->localized_name));
			if (dict->localized_name[0] == 0)
				GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SLOCALIZEDLANGUAGENAME, dict->localized_name, MAX_REGS(dict->localized_name));
			if (dict->localized_name[0] == 0)
				GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SNATIVEDISPLAYNAME, dict->localized_name, MAX_REGS(dict->localized_name));
			if (dict->localized_name[0] == 0 && dict->english_name[0] != 0)
			{
				TCHAR country[1024];
				GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SENGCOUNTRY, country, MAX_REGS(country));

				TCHAR name[1024];
				if (country[0] != 0)
					mir_sntprintf(name, MAX_REGS(name), _T("%s (%s)"), dict->english_name, country);
				else
					lstrcpyn(name, dict->english_name, MAX_REGS(name));

				lstrcpyn(dict->localized_name, TranslateTS(name), MAX_REGS(dict->localized_name));
			}

			if (dict->localized_name[0] != 0)
			{
				mir_sntprintf(dict->full_name, MAX_REGS(dict->full_name), _T("%s [%s]"), dict->localized_name, dict->language);
			}
			break;
		}
	}
	return TRUE;
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:52,代码来源:dictionary.cpp


示例19: GetLocaleInfo

string &FormatNumber(const wchar_t *Src, string &strDest, int NumDigits)
{
	static bool first = true;
	static NUMBERFMT fmt;
	static wchar_t DecimalSep[4];
	static wchar_t ThousandSep[4];

	if (first)
	{
		GetLocaleInfo(LOCALE_USER_DEFAULT,LOCALE_STHOUSAND,ThousandSep,ARRAYSIZE(ThousandSep));
		GetLocaleInfo(LOCALE_USER_DEFAULT,LOCALE_SDECIMAL,DecimalSep,ARRAYSIZE(DecimalSep));
		DecimalSep[1]=0;  //В винде сепараторы цифр могут быть больше одного символа
		ThousandSep[1]=0; //но для нас это будет не очень хорошо

		if (LOWORD(Opt.FormatNumberSeparators))
			*DecimalSep=LOWORD(Opt.FormatNumberSeparators);

		if (HIWORD(Opt.FormatNumberSeparators))
			*ThousandSep=HIWORD(Opt.FormatNumberSeparators);

		fmt.LeadingZero = 1;
		fmt.Grouping = 3;
		fmt.lpDecimalSep = DecimalSep;
		fmt.lpThousandSep = ThousandSep;
		fmt.NegativeOrder = 1;
		first = false;
	}

	fmt.NumDigits = NumDigits;
	string strSrc=Src;
	int Size=GetNumberFormat(LOCALE_USER_DEFAULT,0,strSrc,&fmt,nullptr,0);
	wchar_t* lpwszDest=strDest.GetBuffer(Size);
	GetNumberFormat(LOCALE_USER_DEFAULT,0,strSrc,&fmt,lpwszDest,Size);
	strDest.ReleaseBuffer();
	return strDest;
}
开发者ID:alexlav,项目名称:conemu,代码行数:36,代码来源:strmix.cpp


示例20: winIso639LangName

static QString winIso639LangName(LCID id)
{
    QString result;

    // Windows returns the wrong ISO639 for some languages, we need to detect them here using
    // the language code
    QString lang_code;
    wchar_t out[256];
    if (GetLocaleInfo(id, LOCALE_ILANGUAGE, out, 255)) // ### shouldn't use them according to msdn
        lang_code = QString::fromWCharArray(out);

    if (!lang_code.isEmpty()) {
        const char *endptr;
        bool ok;
        QByteArray latin1_lang_code = lang_code.toLatin1();
        int i = qstrtoull(latin1_lang_code, &endptr, 16, &ok);
        if (ok && *endptr == '\0') {
            switch (i) {
                case 0x814:
                    result = QLatin1String("nn"); // Nynorsk
                    break;
                default:
                    break;
            }
        }
    }

    if (!result.isEmpty())
        return result;

    // not one of the problematic languages - do the usual lookup
    if (GetLocaleInfo(id, LOCALE_SISO639LANGNAME , out, 255))
        result = QString::fromWCharArray(out);

    return result;
}
开发者ID:Afreeca,项目名称:qt,代码行数:36,代码来源:qlocale_win.cpp



注:本文中的GetLocaleInfo函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetLocation函数代码示例发布时间:2022-05-30
下一篇:
C++ GetLocaleByName函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap