-2

All application need multi language support then why Microsoft visual studio have two type of character set's

please clarify me, thanks in advance.

jack
  • 355
  • 1
  • 4
  • 12
  • "All application need multi language support" what's your source? – Luchian Grigore Aug 08 '13 at 11:24
  • @LuchianGrigore It's true that a lot of applications don't need multilanguage support. A lot of what I do at present outputs tables of doubles to Excel; there's no text involved at all. And if your program is generating tax declarations for the French government, your output has to be in French (and to support another country, you'd have to rewrite the program completely, because tax laws are so different). But I use UTF-8 even when I need multi-language support, and others prefer UTF-32 (which MS doesn't support). – James Kanze Aug 08 '13 at 11:46
  • @nijansen It's not just legacy programs which use `std::string`, rather than `std::wstring`, despite what Microsoft says. – James Kanze Aug 08 '13 at 11:47
  • @HansPassant that question is about that character set my question is why VS have a two type of character set ok. – jack Aug 08 '13 at 13:42
  • Yes, that's what that question is about. – Hans Passant Aug 08 '13 at 13:57
  • @HansPassant see this , http://blogs.msdn.com/b/vcblog/archive/2013/07/08/mfc-support-for-mbcs-deprecated-in-visual-studio-2013.aspx – jack Aug 13 '13 at 06:03

1 Answers1

2

First, it's not just Microsoft. C++03 required two character sets. (Formally, I think they can be identical, but I don't know of an implementation on a general purpose machine where they are.) C++11 requires 4 (std::string, std::u16string, std::u32string and std::wstring); regretfully, it doesn't require u16 and u32 versions for the iostream (but that will doubtlessly come).

Different applications have different trade-offs. In the application I'm currently working on, we restrict the character set to what was traditionally called ASCII, so wchar_t would just make things bigger (and so things down, because of less locality). In the text applications I do (or did) on my own time, I used UTF-8 internally; it's no more complex than UTF-16, and for what I do (where international characters are only allowed in a few specific contexts), also requires a lot less space. If I were doing full text processing (say an editor), I'd almost certainly use UTF-32.

As it happens, the choice of 16 bit wchar_t turned out to be a bad choice, as full Unicode requires at least 21 bits. (When Microsoft made the choice, of course, it seemed like the best idea, since Unicode was still 16 bits.) Most other systems (which adopted Unicode much later) have a 32 bit wchar_t. (The exception is IBM, which also adopted Unicode very early.)

James Kanze
  • 150,581
  • 18
  • 184
  • 329