Could someone give some info regarding the different character sets within visual studio's project properties sheets.
The options are:
None
Unicode
Multi byte
I would like to make an informed decision as to which to choose.
Thanks.
Could someone give some info regarding the different character sets within visual studio's project properties sheets.
The options are:
None
Unicode
Multi byte
I would like to make an informed decision as to which to choose.
Thanks.
All new software should be Unicode enabled. For Windows apps that means the UTF-16 character set, and for pretty much everyone else UTF-8 is often the best choice. The other character set choices in Windows programming should only be used for compatibility with older apps. They do not support the same range of characters as Unicode.
Multibyte
takes exactly 2 bytes per character, none
exactly 1, unicode
varies.
None
is not good as it doesn't support non-latin symbols. It's very boring if some non-English user tries to input their name into edit box. Do not use none
.
If you do not use custom computation of string lengths, from programmer's point of view multibyte
and unicode
do not differ as long as use use TEXT
macro to wrap your string constants.
Some libraries explicitly require certain encoding (DirectShow
etc.), just use what they want.
As Mr. Shiny recommended, Unicode is the right thing. If you want to understand a bit more on what are the implications of that decision, take a look here: http://www.mihai-nita.net/article.php?artID=20050306b