Hi Vlad,
I believe, the issue has something to do with code pages and limited Unicode support in the Windows command prompt. For example, if you put the commands to a batch file and run it directly from Windows Explorer, you'll get the same result.
reg add "HKCU\Control Panel\International" /v sCurrency /t REG_SZ /d € /f
reg query "HKCU\Control Panel\International" /v sCurrency
I'd actually recommend using TestComplete's
aqEnvironment.SetLocalInfo and
aqEnvironment.GetLocaleInfo methods instead to change the regional settings. Your script will be much shorter and easier to understand. :)
function Test() {
var WM_SETTINGCHANGE = 0x001A;
var sCurrency = "€"; //euro symbol
if (aqEnvironment.SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SCURRENCY, sCurrency)) {
// If no error, notify all running applications about the settings change
SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0, SMTO_NORMAL, 30000, 0); // 30 sec timeout
var sCurrencyNew = aqEnvironment.GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SCURRENCY);
if (sCurrencyNew != sCurrency) {
Log.Warning("The currency symbol was NOT set correctly, it should be " + sCurrency + " !");
}
else {
Log.Checkpoint("The currency symbol was set correctly to " + sCurrency + ".")
}
}
else {
Log.Error("Could not change the currency symbol.");
}
}