C++ Logo


Advanced search

Re: [SG16] Please help me!!!

From: Tom Honermann <tom_at_[hidden]>
Date: Fri, 18 Dec 2020 10:07:59 -0500
Hi, George. You might try posting your question to stackoverflow.com
<https://stackoverflow.com>. If you search for _setmode, _O_U16TEXT,
and/or _O_U8TEXT there, you'll find answers to some related questions,
possibly some that already explain what you are observing. Take a look
at this post

In general, getting the Windows console to display non-ASCII characters
can be challenging for a variety of reasons, especially when using
std::cout or printf().


On 12/18/20 7:56 AM, Jens Maurer via SG16 wrote:
> Hi George,
> This mailing list is for discussion of C++ standardization.
> Your code contains many function calls that are not part
> of the C++ standard, and have not been proposed to be part
> of the C++ standard. Maybe you are on a Windows environment;
> if so, consider contacting Microsoft technical support for
> help. (Note: This is not an endorsement of Microsoft, and
> I have no clue whether such approach would bear costs upon
> you.)
> In short, this mailing list is not a technical support forum.
> Jens
> On 18/12/2020 13.21, George Gialopoulos via SG16 wrote:
>> Code:
>> *
>> *
>> *_setmode(_fileno(stdout),_O_U16TEXT);*
>> * wprintf(L"\x00B2");*
>> * _setmode(_fileno(stdout),_O_U8TEXT);*
>> * cout << " as it is.\n";*
>> These are 4 lines of code of a program I am working on. So, basically I am trying to add a unique character, the symbol of power of 2 it is, so I set the mode as above to '16TEXT' and then printed the character in the 2nd line. Finally I wanted to add some more text, so i turned the mode to '8TEXT'. Then I put a 'cout' to whrite the rest of the text but it didn't print anything. I would be really thankful if you could advise me. Thank you for your attention.
>> (I am not quite sure that I sent this message to the right email. So, if not, please forward it to the right if you know it)

Received on 2020-12-18 09:08:02