Display Japanese Characters as output

Hi people,
Just out of curiosity, is there a simple way to display Japanese Characters? Currently, it is printing some random symbols, as shown in the attachments. It is not a requirement for our project, but I was thinking of making the TripleX game in Japanese as I am currently studying Japanese also, so I thought I could use my Japanese here by making the game in Japanese.

#include <iostream>

#include <io.h>

#include <fcntl.h>

int main()

{

    _setmode(_fileno(stdout), _O_U16TEXT);

    std::wcout << L"連続関数が必ずしも微分可能だとは限らない。";

    return 0;

}

Thank you for helping out :smiley: However, I copied and pasted your code, but it is still printing the output as random symbols :frowning: Did you have to add on something on Visual Studio?

Compile with /utf-8

cl triplex.cpp /EHsc /Zi /utf-8

Thank you Dan! Compiling with utf-8 did the trick :slight_smile:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms