Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/plugin/PluginSystem.cpp

Issue 5516878722105344: Issue #276 - replace TCHAR etc. with wide-character versions (Closed)
Patch Set: Created Aug. 5, 2014, 3:17 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/plugin/PluginFilter.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include "PluginSystem.h" 3 #include "PluginSystem.h"
4 #include "PluginClient.h" 4 #include "PluginClient.h"
5 5
6 std::wstring GetBrowserLanguage() 6 std::wstring GetBrowserLanguage()
7 { 7 {
8 LANGID lcid = GetUserDefaultLangID(); 8 LANGID lcid = GetUserDefaultLangID();
9 TCHAR language[128]; 9 wchar_t language[128];
10 memset(language, 0, sizeof(language)); 10 memset(language, 0, sizeof(language));
11 TCHAR country[128]; 11 wchar_t country[128];
12 memset(language, 0, sizeof(country)); 12 memset(language, 0, sizeof(country));
13 13
14 std::wstring lang; 14 std::wstring lang;
15 int res = GetLocaleInfoW(lcid, LOCALE_SISO639LANGNAME, language, 127); 15 int res = GetLocaleInfoW(lcid, LOCALE_SISO639LANGNAME, language, 127);
16 if (res == 0) 16 if (res == 0)
17 { 17 {
18 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_ERROR_SYSINFO _BROWSER_LANGUAGE, "System::GetBrowserLang - Failed"); 18 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_ERROR_SYSINFO _BROWSER_LANGUAGE, "System::GetBrowserLang - Failed");
19 } 19 }
20 else 20 else
21 { 21 {
22 lang += language; 22 lang += language;
23 } 23 }
24 lang += L"-"; 24 lang += L"-";
25 res = GetLocaleInfoW(lcid, LOCALE_SISO3166CTRYNAME, country, 127); 25 res = GetLocaleInfoW(lcid, LOCALE_SISO3166CTRYNAME, country, 127);
26 if (res == 0) 26 if (res == 0)
27 { 27 {
28 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_ERROR_SYSINFO _BROWSER_LANGUAGE, "System::GetBrowserLang - failed to retrieve country"); 28 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_ERROR_SYSINFO _BROWSER_LANGUAGE, "System::GetBrowserLang - failed to retrieve country");
29 } 29 }
30 else 30 else
31 { 31 {
32 lang += country; 32 lang += country;
33 } 33 }
34 return lang; 34 return lang;
35 } 35 }
OLDNEW
« no previous file with comments | « src/plugin/PluginFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld