wchar_t

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Mr_Ridd
Posts: 63
Joined: Tue Sep 28, 2004 5:16 am

wchar_t

Post 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
zgock
Posts: 12
Joined: Wed Sep 29, 2004 2:06 pm
Location: Japan
Contact:

Post 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
Guest

Post 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/
Post Reply