vlad230
13 years agoContributor
Using Symbols
Hi guys,
I'm trying to change my machines regional settings by modifying the registry entries using TC8. Currently I'm trying to change the currency but I'm having a few issues with it.
Basically, I'm opening command prompt and entering a string which changes the registry.
I'm trying to change the currency to the EURO symbol (€, ALT+0128) but the issue is that the value reflected in the regional settings for currency isn't the euro symbol but this symbol: Ç (ALT+128). It seems that by some reason the "0" character is left out somehow and this causes the character to change.
I've encountered the same issue with the POUND symbol (£, ALT+156) but this was resolved by using the character: œ (ALT+0156) which was displayed as the pound symbol in regional settings.
I've also tried to use unicode or hex to define the characters but with no luck.
Do you guys have any ideas on how I could do this?
Here's the code I'm using:
Thanks,
Vlad
I'm trying to change my machines regional settings by modifying the registry entries using TC8. Currently I'm trying to change the currency but I'm having a few issues with it.
Basically, I'm opening command prompt and entering a string which changes the registry.
I'm trying to change the currency to the EURO symbol (€, ALT+0128) but the issue is that the value reflected in the regional settings for currency isn't the euro symbol but this symbol: Ç (ALT+128). It seems that by some reason the "0" character is left out somehow and this causes the character to change.
I've encountered the same issue with the POUND symbol (£, ALT+156) but this was resolved by using the character: œ (ALT+0156) which was displayed as the pound symbol in regional settings.
I've also tried to use unicode or hex to define the characters but with no luck.
Do you guys have any ideas on how I could do this?
Here's the code I'm using:
function readCMDoutput(command){
//input: command is a string containing teh command you want to run in cmd.exe
//returns a string containg CMD's output
var WshShellObj = new ActiveXObject("WScript.Shell");
var WshShellExecObj = WshShellObj.Exec("cmd.exe");
//send command and exit
WshShellExecObj.StdIn.Write(command+"\n exit\n");
//read all the output
var out = WshShellExecObj.StdOut.ReadAll();
Log.Message("CMD output: "+out);
return out;
}
//sCurrency
var sCurrency = "€"; //euro symbol
var regAddQuery ='reg add "HKCU\\Control Panel\\International" /v sCurrency /t REG_SZ /d "'+sCurrency+'" /f';
readCMDoutput(regAddQuery);
//re-check if the values are correct
var regQuery ='"HKCU\\Control Panel\\International" /v sCurrency';
var command = "reg query "+regQuery
var checkData = readCMDoutput(command);
if(aqString.Find(checkData, sCurrency) < 0){
Log.Warning("sCurrency was NOT set correctly, it should be "+sCurrency+" !");
ok = false;
}
else{ Log.Checkpoint("sCurrency was set correctly to "+sCurrency+".");}
Thanks,
Vlad