Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C (http://www.programmingforums.org/forum60.html)
-   -   wchar_t and ascii (http://www.programmingforums.org/showthread.php?t=12771)

iradic Mar 12th, 2007 3:14 PM

wchar_t and ascii
 
Hi,
Is it ok to assume that ascii characters have the same value for char and wchar_t types.

That is:
:

char 'a' == wchar_t L'a'

Bye

Ooble Mar 13th, 2007 7:22 AM

According to the standards, yes, it's fine. However, wchar_t is only required to be at least 8 bits, so you can't necessarily use it for UTF-16 or other two-byte character implementations unless you can guarantee the compiler and OS support it.


All times are GMT -5. The time now is 2:07 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC