Page 1 of 1
wchar_t
Posted: Fri Oct 08, 2004 6:29 am
by Mr_Ridd
Hey
Why does Irrlicht use wchar_t instead of just char? I've looked in google to find advantages but I haven't had any luck.
Thanks
Posted: Fri Oct 08, 2004 7:28 am
by zgock
It is very important for supporting multi-language.
cos non-roman language has over 10000ish chars.
(for example Japanese uses 16000ish chars)
i couldn't make my truetype module if it was char instead of wchar_t
Posted: Fri Oct 08, 2004 7:34 am
by Guest
Because there are more characters than just those used in English.
The char type is 8 bits, which means a maximum of 255 characters. (0 is used to terminate strings, and in fact there are also some control characters, which I'll ignore in this discussion).
Wide chars use 16 bit encoding so they can handle 65535 different characters.
I myself am not a fan of 16-bit encoding by the way, because it still cannot represent all characters anyway.
Here's somebody who can explain it all a bit better:
http://www.joelonsoftware.com/articles/Unicode.html
More info on unicode:
http://www.unicode.org/