1
說,我可以用_create_locale這樣從我的C程序中設置的語言環境:如何獲取我的線程的語言環境名稱?
localeUS = _create_locale(LC_ALL, "English_United States.1252");
但我需要的是相反的,即檢索區域名稱(函數的第二個參數上面)調用線。任何想法如何做到這一點?
PS。我知道現代Windows使用LCID。爲了與舊代碼兼容,我需要此區域名稱。
感謝。剛剛通過逆向工程發現你的示例,簡單地做'strCurrentLocale = setlocale(LC_ALL,「」);'會做我需要的。 – c00000fd 2013-05-08 02:13:22
根據鏈接文檔,'std :: locale()'*「構造**全局** C++語言環境」*「的副本。沒有記錄'std :: locale(「」)'的行爲。由於Windows控制每個線程的語言環境,因此檢索當前線程的語言環境的方法是什麼? – IInspectable 2017-08-01 01:57:04