use proper scancode to create upper-case hex numbers directly
Modified: trunk/reactos/lib/cpl/intl/locale.c

Modified: trunk/reactos/lib/cpl/intl/locale.c
--- trunk/reactos/lib/cpl/intl/locale.c	2005-05-11 09:56:24 UTC (rev 15204)
+++ trunk/reactos/lib/cpl/intl/locale.c	2005-05-11 13:20:34 UTC (rev 15205)
@@ -95,6 +95,7 @@
 	HKEY langKey;
 	DWORD ret;
 	TCHAR value[9];
+	DWORD lenvalue;
 
 	ret = RegOpenKeyW(HKEY_CURRENT_USER, L"Control Panel\\International", &localeKey);
 
@@ -105,9 +106,10 @@
 		return;
 	}
 
-	wsprintf(value, L"%04x", (DWORD)lcid);
+	wsprintf(value, L"%04X", (DWORD)lcid);
+	lenvalue = wcslen(value);
 
-	RegSetValueExW(localeKey, L"Locale", 0, REG_SZ, (BYTE *) _wcsupr(value), sizeof(value));
+	RegSetValueExW(localeKey, L"Locale", 0, REG_SZ, (BYTE *)value, lenvalue * sizeof(WCHAR));
 	RegCloseKey(localeKey);
 
 	// Set language
@@ -116,8 +118,8 @@
 	if (ret != ERROR_SUCCESS)
 		return;
 
-	RegSetValueExW(langKey, L"Default", 0, REG_SZ, (BYTE *)_wcsupr(value), sizeof(value));
-	RegSetValueExW(langKey, L"InstallLanguage", 0, REG_SZ, (BYTE *) _wcsupr(value), sizeof(value));
+	RegSetValueExW(langKey, L"Default", 0, REG_SZ, (BYTE *)value, lenvalue * sizeof(WCHAR));
+	RegSetValueExW(langKey, L"InstallLanguage", 0, REG_SZ, (BYTE *)value, lenvalue * sizeof(WCHAR));
 	RegCloseKey(langKey);
 }