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?
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
constwchar_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 АБВГ"
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