Hello everyone, I have a problem storing special characters with uVision editor. When I store the following line which stand in a example.c file:
printf("æ Æ Ø ø å Â");
printf("\x91 \x92 \x9D \x9B \x86 \xB6");
"I have a problem storing special characters with uVision editor." No. You have a misunderstanding of exactly what ASCII defines and does not define. This is nothing to do with Keil, uVision, 'C', printf, ... "it is converted to incorrect ASCII values." They are not valid ASCII codes at all - so what you actually get is undefined! ASCII defines only code 0-127 (7 bits); there are many extensions to ASCII that use code 128-255 - but you need to define precisely which extension you're using if you want to be sure of what you'll get. printf does not directly support this.
I think it has something to do with the so called translation environment and execution environment, as defined in C standards. The ISO C 1999 standard only requires the toolset to implement 92 printable characters (with no mention of the ASCII encoding). Anything beyond that is an extension of the standard. The developers of the toolset are free to implement those extensions as they please. Hopefully this answers the "Why ... ?" question. Regards, - mike
The codes for (and even the presence of) ("æ Æ Ø ø å Â") vary from keyboard to keyboard. In countries where they are commonly used they are implemented as substitutions (if my memory serves me correctly in Denmark '$' print as "Ø") Anything abve 7f and certainly æ Æ Ø ø å Â is NOT ASCII (remember 'A' im ASCII stan for 'American'). Erik
View all questions in Keil forum