VS2019 Unicode and MBCS setting

abc abc 351 Reputation points
2021-11-22T13:59:44.683+00:00

Hi,

VS2019 by default using Unicode UTF8, this will support all languages. If I select Portuguese, can I use this appliation only in the system which has english codepage ? Unicode UTF8 supports only wchar, if I select Portuguese can I use char? Whether all code pages will come under MBCS other than Unicode UTF8?
151487-codepage.png

Thanks

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,751 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Minxin Yu 11,916 Reputation points Microsoft Vendor
    2021-11-23T09:28:33.6+00:00

    Hi, @abc abc

    I'm afraid this can't be done. I tested to print

    const char a = 'ê';  
    string b = "português";  
    

    in different unicode pages, and only the Portuguese version can be printed successfully.
    In Windows, "MBCS" only refers to character encodings that can be used with the "A" versions of the Windows API functions.
    For your reference: Difference between MBCS and UTF-8 on Windows.

    Best regards,

    Minxin Yu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.