ascii of wide char

Apr 26, 2009 at 7:54pm
Hello. I have a problem. the ascii code in unicode of ἶ is 7990 in Greek language.
I am trying to take the 7990 on screen and i can't. Any help?
Thank's
Jim

1
2
wchar_t* ch=L"εἶναι";
        cout << ch[1]<<endl;
Last edited on May 14, 2009 at 7:56am
Apr 26, 2009 at 9:13pm
You are delving into character encodings and character sets -- it's not really a beginners topic.

ASCII is an 7-bit character set that only encodes enough of the latin alphabet to display (American) english. It doesn not support any other alphabet. That is not to say that what you want cannot be done. But it would be helpful to know what platform this is running on (Windows, OS X, Unix, Linux, etc.) Some part of the answer is likely to be platform specific.
Apr 27, 2009 at 4:45am
I am running windows xp home Greek adition.
Last edited on May 14, 2009 at 8:01am
Apr 27, 2009 at 11:06am
cmd.exe isn't very good at all at printing Unicode. You should set your code page to ISO-8859-7, and then convert the Unicode string to that same encoding. Then you should be able to see Greek characters.
You can find a plaintext Unicode-ISO-8859-7 conversion table which you can process into an array here: http://www.haible.de/bruno/charsets/conversion-tables/ISO-8859-7.tar.bz2
Apr 27, 2009 at 11:51am
Thank's but my needs is for c++ program. I must obay a unique number of a wchar_t in base of ascii*16^i , i is the place of char, and of cource i must have for example ἶ the 7990 integer.
Last edited on May 14, 2009 at 8:01am
Apr 27, 2009 at 12:47pm
Thank's but mu needs is for c++ program.
The solution I gave you is for no language in particular, so it can be used in C++.

Like I said, cmd.exe cannot handle Unicode. You have no choice but to do encoding conversion if you want to output non-latin characters. Otherwise, the user will just see a string of question marks.
Apr 27, 2009 at 2:24pm
Thank's
You help me a lot, not only this time. Good day.
Jim

Topic archived. No new replies allowed.