Keil Logo

C51: Wide Character Support


Information in this article applies to:

  • C51 Version 5.50a
  • C51 Version 6.03

QUESTION

I must implement UNICODE using Wide Characters in C. I noticed that in STDLIB.H in the INC directory the following is defined:

#ifndef _WCHAR_T_DEFINED_
#define _WCHAR_T_DEFINED_
typedef char wchar_t;
#endif

Shouldn't wchat_t be defined as an unsigned int or and unsigned short?

ANSWER

Yes. It probably should. However, the Keil C51 Compiler V6 and earlier does not support wide characters.

The tools do not use this data type, so you are free to change it to whatever suits your needs. Note that printf and the other library routines to not support wide characters. So, you'll have to write your own routines to provide that support.

We may incorporate wide character support in future releases of the tools.

MORE INFORMATION


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.