What I want is to display a line with a Chinese letter, entered by the user. Though the program DevC++.
This is my code:
#define UNICODE
#include <iostream>
#include <string>
using namespace std;
extern wostream wcout;
int main(int argc, char** argv) {
std::wstring kanji = L"?";
//std::wchar_t stop = L"0";
std::wcout << L"\n\nWelcome to the Chinese letter program\n";
std::wcout << L"The program will ask you for one Chinese letter\n";
std::wcout << L"Then press enter, and a message will display.\n";
std::wcout << L"Once you are done,you can enter another Chinese letter\n";
std::wcout << L"To exit just close the Ubuntu's terminal'\n\n";
for(int x = 0; x < 80; x++){
std::wcout << L"Give me one Chinese letter...";
wcin >> kanji;
std::wcout << L"The Chinese letter is \"" << kanji << "\".\n\n";
}
return 0;
}
What matters to me is the "The Chinese letter is "(kanji)"." line. When I do what the program says I get "The Chinese letter is "?".". So the problem is that DevC++ doesn't show the Chinese letters correctly, even when I using the wcin and wcout things.
Note I am using DevC++ on Ubuntu, through wine.