views:

204

answers:

3

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.

+7  A: 

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.

Mr. Shiny and New
Great advice thanks.
Adam Naylor
+1  A: 

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.

Quassnoi
Well, double byte takes exactly 2. Non-Unicode multi-byte takes 1 or 2 bytes per character.
KJAWolf
Agree with KJAWolf; "Unicode" means UTF-16 which is exactly 2 bytes. Multibyte is e.g. Shift-JIS, in which case the ASCII subset is still 1 char per character.
MSalters
UTF-16 uses 4 bytes for the supplementary planes.
dan04
+1  A: 

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

Mihai Nita
Thanks i'll take a read
Adam Naylor