- 1
How can I print other languages in C++
Title. I want to print something in Hebrew (my language) and I can't for example cout<<"שלום"; Does someone knows how to do it?
14 Answers
+ 2
for example for russian:
setlocale(LC_ALL, "rus");
+ 2
I don't think these characters belong to ASCIl set.
+ 1
Cout code?
+ 1
Cout
You can actually do it like you did, though the problem is that some console can't recognize non-ASCII character
+ 1
Cout
I guess there's nothing much you can do except changing the console to a console which supports non-ASCII character
+ 1
Martin Taylor I am already on it. Thanks anyway.
0
Maria Vasilyova it's not working
0
Maria Vasilyova what
0
Agent_I yeah that's why I can't
0
Agent_I the amount of time that people told me "that's impossible" in programming, is equivalent of the time I proved them wrong
0
Cout
So the point of you telling me this is?
0
Agent_I the point of me telling you this is because you are wrong, and you should never say it
0
Cout
I never said it's impossible, I said that it's hard to be done if you want to stick to the output console which doesn't support non-ASCII character. I know that anyone can modify any program however they want as long as they know how it works. Let me give you this analogy, you want to write a biography about yourself in Hebrew, but you can't write a book, so you ask your friend who is a writer to help you out. However, he doesn't know anything about Hebrew. So you have two options, you can either teach your friend Hebrew until he understand it, which will cost time and energy no matter how good you are at teaching, or you can find another writer who already understand it.
Now, if you want to stick with Sololearn playground, go ahead, but I can't help you with that. The choice is yours, why hurt yourself?