kanji system wont show on console

Using Visual Studio 2012 i want to show the characters of the kanji system (japanese). I see that the unicode has some standards about it, so i added "/u8560". Instead of showing the kanji character, it shows a ? sign. Can anyone help make it?

The code is this:
1
2
3
4
5
6
7
8
9
#include <iostream>

using namespace std;

int main()
{
cout << "\u8560";
cin.get();
}
Last edited on
I tried it with
wcout << L"\u8560";
and it still won't show.
Any help?

this is the code
1
2
3
4
5
6
7
8
9
10
#include <iostream>

using namespace std;

int main()
{
	wchar_t \u30c0 = '\u40c0';
	wcout << \u30c0;
	cin.get();
}
Last edited on
I tried it like this:
1
2
3
4
5
6
7
8
9
10
#include <iostream>

using namespace std;

int main()
{
	wchar_t \u30c0[] = L"\u40c0 is good";
	wcout << \u30c0;
	cin.get();
}

It still won't work!
I see that the unicode has some standards about it

Indeed, Unicode has some standards, but Microsoft doesn't care (except for STL, the guy who develops the C++ standard library: C++11's unicode conversions work perfectly since 2010)

Anyway, to your problem

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
#include <fcntl.h>
#include <io.h>
int main()
{
    // the following line is required to print wide
    // characters to Windows Console
    _setmode(_fileno(stdout), _O_WTEXT);
  
    // now you can just send wchar_t, wstring, etc. to wcout
    const wchar_t* str = L"䃀 is good, and so is ΑΒΓΔ and АБВГ";
    std::wcout << str << '\n';
    // use Ctrl+F5 to run your program, skip "cin.get()" and the like
}


If you now see squares on your console instead of any of these non-latin characters, your console font does not have these glyphs. The program prints them correctly, but the console can't display them. Either find and install the font, or redirect your output to a file and open it with a Notepad:

C:\Users\Cubbi\Documents\Visual Studio 2012\Projects\ConsoleApplication1
\Debug>ConsoleApplication1.exe > test.txt

C:\Users\Cubbi\Documents\Visual Studio 2012\Projects\ConsoleApplication1
\Debug>start test.txt

This opens up Notepad for me, which contains exactly the line "䃀 is good, and so is ΑΒΓΔ and АБВГ"
Last edited on
It shows the characters you gave, with the exception of the first 3 special ones.
I added kanji and it didn't work :/
So you must be right.
Thanks for reply
Topic archived. No new replies allowed.