From: "Brian Smith" <[EMAIL PROTECTED]>
 > If it's always a typedef for char, then what's its point? I thought it
 > was so you could change that to a wide-character type.

 That's what WChar is for...
OK, then what is the purpose of these typedefs? Why not just use char and
wchar_t instead of Char and WChar?
Using wchar_t has problems, as its size, depending on the platform/compiler/header file switches, has ranged from 8 bits up to 32 bits. There was a reference to this issue on IBM's developer site, which I can't find right now, that said:

"wchar_t is compiler-dependent and therefore not very portable. Using it for Unicode binds a program to the character model of a compiler. Instead, it is often better to define and use dedicated data types."

Also see <http://oss.software.ibm.com/developerworks/opensource/cvs/~checkout~/icu/source/common/unicode/utf.h> for examples of what one developer did to try to safely base the Unicode character type on the wchar_t type.

As for Char - got me. It would have been great if the original developers of Palm OS had defined this as an unsigned char, thus avoiding many bugs caused by sign-extension of character values.

Just be thankful you never had to deal with Int, Word, ULong, and other acts of the devil.

-- Ken
--
Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-470-9200

--
For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to