I was wondering if there is a library or smt that can allow a programmer to use other foreign languages in C++. For instance i want my c++ program to display some Greek messages that i will define, but instead i get some garbage. Is there anyway to call unicodes directly from c++ or i must convert my whole linux box to support greek in order to be able to see to my console some greek output..?
jepapel 0 Newbie Poster
Recommended Answers
Jump to Post>i want my c++ program to display some Greek messages that i will define, but instead i get some garbage
It works for me:#include <iostream> int main() { std::cout<<"?ん!\n"; }
This prints out, as expected:
$ ./a.out ?ん!
But then again, I have …
Jump to Post>when i use the greek char array alphbet i get compiler errors
If your compiler refuses to cooperate, you can diddle the locale:#include <iostream> #include <locale> int main() { std::cout.imbue ( std::locale ( "Greek" ) ); std::cout<<"αβγδεςζηθικλμνξόπσςτυφχψω\n"; }
But the string for std::locale() is different for …
Jump to Posttried using wchar_t instead of char?
All 9 Replies
bumsfeld 413 Nearly a Posting Virtuoso
Narue 5,707 Bad Cop Team Colleague
jepapel 0 Newbie Poster
jepapel 0 Newbie Poster
Narue 5,707 Bad Cop Team Colleague
zyruz 0 Junior Poster in Training
gyle0123 0 Newbie Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Plato_1981 -8 Newbie Poster
Narue commented: Someone won't get help because you posted this. Was it worth replying to a four year old thread? -4
Ancient Dragon commented: The code you posted is wrong -- its just an infinite loop. -4
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.