| | |
How to get Dev-Cpp to support chinese characters and pinyin.
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2008
Posts: 36
Reputation:
Solved Threads: 0
How can I get a compiler for C++ like Dev-Cpp to support chinese character and pinyin input? Like if I wanted to make a chinese program that would allow chinese input and output in the console window... Example:
etc.
So pinyin is like 'xìng' and the characters are like '姓'. So some how im wondering how I could create a program that would be like a dictionary type thing.
BONUS:
你教什么名字 = nǐ jiáo shén me míng zi? = whats your full name?
您好 = nín hǎo! = hello! (Respectfully).
今天星期二 = jīn tiān xīng qī èr = today is tuesday.
星期 = xīng qī = week.
C++ Syntax (Toggle Plain Text)
#include <iostream> using namespace std; int main() { wchar_t input; char loop; loop='a'; while(loop = 'a') { system("CLS"); cout << "Input Chinese Characters or pinyin to translate to english: "; cin >> input; if(input = "你") { cout << "nǐ = you" << endl; } if(input = "您") { cout << "nín = you (with respect)" << endl; } if(input = "我") { cout << "wǒ = I; me; my; (anything that has to do with yourself)" << endl; } if(input = "星") { cout << "xīng = star;" << endl; } if(input = "期") { cout << "qī = period of time; " << endl; } if(input = "子") { cout << "zi = word; character;" << endl; } if(input = "好") { cout << "hǎo = to be good/well;" << endl; } if(input = "姓") { cout << "xìng = family name; last name;" << endl; } if(input = "今") { cout << "jīn = now;" << endl; } if(input = "天") { cout << "tiān = today; sky;" << endl; } } return 0; }
etc.
So pinyin is like 'xìng' and the characters are like '姓'. So some how im wondering how I could create a program that would be like a dictionary type thing.
BONUS:
你教什么名字 = nǐ jiáo shén me míng zi? = whats your full name?
您好 = nín hǎo! = hello! (Respectfully).
今天星期二 = jīn tiān xīng qī èr = today is tuesday.
星期 = xīng qī = week.
•
•
Join Date: Oct 2007
Posts: 305
Reputation:
Solved Threads: 43
I don't think there is a type that will allow you support chinese characters natively. You will need some kind of unicode support for it. I don't know if there is an external library out there that will allow you to read these in. But in the absence of that, you will need to build in a mapping table, and map the bytes you are reading in to your table, and probably have another table for any corresponding translated values.
![]() |
Other Threads in the C++ Forum
- Previous Thread: need help simplifying codes
- Next Thread: GPA calculator c++
| Thread Tools | Search this Thread |
api application array arrays beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete desktop developer directshow dll email encryption error file format forms fstream function functions game generator getline graph homeworkhelper iamthwee ifstream image input int integer java lib linux loop looping loops map math matrix memory multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return sorting string strings struct studio template templates text tree url vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






