This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Printf problem with special characters like: æ Æ Ø ø å Â

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("æ Æ Ø ø å Â");
it is converted to incorrect ASCII values.

I can solved the problem by replacing the line and use the correct ASCII value as hex codes:

 printf("\x91 \x92 \x9D \x9B \x86 \xB6");
Then of course it is working fine but not very readable.

Why converts uVision these special characters and why do I not have this problem with other C-editors like UltaEdit?

(I use uVision2 v2.4)

Parents
  • "So, with other words uVision stores 'keyboard-pressed' [Alt-145] to 'file viewing' [Alt-230].

    No, it doesn't. You still don't get it, it seems. You still believe that the key on your keyboard labelled 'æ' must always generate the character code 145 (0x91). But that belief is wrong."

    No, that is *not* what he is saying. He is saying, quite correctly, that if he holds down the ALT key in uvision then presses the keys '1' followed by '4' followed by '5' on his numeric keypad he sees the character 'æ'. If he than saves the file and views it in a hex editor he sees that the value 0xE6 (230) has been stored rather than the value 0x91 (145).

    Stefan

Reply
  • "So, with other words uVision stores 'keyboard-pressed' [Alt-145] to 'file viewing' [Alt-230].

    No, it doesn't. You still don't get it, it seems. You still believe that the key on your keyboard labelled 'æ' must always generate the character code 145 (0x91). But that belief is wrong."

    No, that is *not* what he is saying. He is saying, quite correctly, that if he holds down the ALT key in uvision then presses the keys '1' followed by '4' followed by '5' on his numeric keypad he sees the character 'æ'. If he than saves the file and views it in a hex editor he sees that the value 0xE6 (230) has been stored rather than the value 0x91 (145).

    Stefan

Children
No data