Quantum
2006-10-09 11:08:30 UTC
Hi all,
I'm struggling with a couple of things re:WM_CHAR and charsets.
When I get a WM_CHAR message, I can get the character code as an integer
by:
int intVal=(int)wParam;
However, that integer value depends on what character set is currently
being used, correct?
So, lets say I'm using the standard Windows character set, WINDOWS-1252.
Then the intVal will have the int value that is the int value of the
char when checked against the WINDOWS-1252 charact set. Yes?
However, if I change character sets in Windows (I don't know how, but I
know you can...) to say ISO-8859-8 (the Hebrew one), then pressing
exactly the same physical key on the keyboard would generate a
completely different char and int value?
If that lot is correct, then I've got a question if I may:
1) Is there a way I can convert the intVal I get from a WM_CHAR message
into the equivalent character on a seperate character set I specify. So
maybe some function like this:
-----------------------------------------------------
//aVal is just the (int)wParam value.
//aCharSet is the charset to convert aVal to.
int convertIntoCharset(int aVal, CharSet aCharSet){
origCharSet=GetCurrentCharSet();
int newVal=//Do some calculation with origCharSet and aCharSet.
return newVal;
}
//Returns -1 if there is no equivalent char on aCharSet.
//Otherwise returns the equivalent int value on aCharSet.
-----------------------------------------------------
Thanks for your time.
Q
I'm struggling with a couple of things re:WM_CHAR and charsets.
When I get a WM_CHAR message, I can get the character code as an integer
by:
int intVal=(int)wParam;
However, that integer value depends on what character set is currently
being used, correct?
So, lets say I'm using the standard Windows character set, WINDOWS-1252.
Then the intVal will have the int value that is the int value of the
char when checked against the WINDOWS-1252 charact set. Yes?
However, if I change character sets in Windows (I don't know how, but I
know you can...) to say ISO-8859-8 (the Hebrew one), then pressing
exactly the same physical key on the keyboard would generate a
completely different char and int value?
If that lot is correct, then I've got a question if I may:
1) Is there a way I can convert the intVal I get from a WM_CHAR message
into the equivalent character on a seperate character set I specify. So
maybe some function like this:
-----------------------------------------------------
//aVal is just the (int)wParam value.
//aCharSet is the charset to convert aVal to.
int convertIntoCharset(int aVal, CharSet aCharSet){
origCharSet=GetCurrentCharSet();
int newVal=//Do some calculation with origCharSet and aCharSet.
return newVal;
}
//Returns -1 if there is no equivalent char on aCharSet.
//Otherwise returns the equivalent int value on aCharSet.
-----------------------------------------------------
Thanks for your time.
Q