Keil Logo

GENERAL: Compiler Ignores 0XFD, 0XFE, 0XFF Values in Strings


Information in this article applies to:

  • C166
  • Cx51
  • C251

QUESTION

I have a problem with the interpretation of Russian strings in the Keil C51 compiler.

Some Russian characters are using the encoding 0xFD. It looks like this encoding is ignored by the compiler and is not included in the program code.

Example:

code char RussianString[] = "??? ????";

Why does this problem exist, and how can I avoid this behavior?

ANSWER

The character encodings 0xFD, 0xFE, and 0xFF are used internally by the C compiler.

The ANSI standard only requires support for ASCII characters in the range 0x00 - 0x7F.

You may insert these characters by using HEX encodings in the string as follows:

code char RussianString[] = "My Text" "\xFD";

A simple text replacement which replaces all 0xFD characters with the string '" "\xFD' should do the job.

SEE ALSO


Last Reviewed: Thursday, February 25, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.