c++mfcinternationalizationmbcs

Risks of running on single byte character app on a MBCS OS


I have an MFC application where the Character Set is "Not Set". What are the risks associated with running this application on a OS that has a Multi Byte Character Set code page?


Solution

  • The "Character Set: Not Set" option defines neither _MBCS nor _UNICODE. That means that you're using the *A series of functions. Those will return MBCS strings, even when _MBCS is not defined.

    If _MBCS doesn't affect the strings returned from the *A functions, then what does it do? It maps some <tchar.h> tcs* functions to their mbs* versions, instead of the str* or wcs* variants. E.g. without _MBCS, _tcsrev maps to strrev, not _mbsrev.

    Therefore, you may not be able to reverse the multi-byte strings you receive from the OS, or edit them otherwise.