June 28, 2009 Re: How to print Chinese characters in console in window XP? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Elrood | Dear All: Thank you so much for all your help! Yes,I am using xp+sp3 Chinese version and can print Chinese font in the console in C++ program: #include <iostream> int main(int argc,char* argv[]) { std::cout<<"Öйú"<<std::endl; return 0; } |
June 29, 2009 Re: How to print Chinese characters in console in window XP? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Elrood | Elrood wrote: > While it certainly wasn't my intent to spread false info, nor to defend D or sidetrack from its bugs, I cannot confirm that unicode output *just plain works*, neither with Python, and I'd be highly interested in more info on how you got it to work. There are two separate issues here. One is unicode output (which involves translating unicode text to the encoding used by the console). The other issue is having a console window that can display the characters that you want to display. The former can be tested without resorting to exotic code pages. Try to output 'Ķ' in CP775 or 'İ' in CP857. Both of these code pages are readily available. To enable Chinese characters, some more work is necessary. Under Windows XP, Control Panel, Regional and Language Options: - On the Languages pane, make sure East Asian Languages is checked. - On the Advanced pane, select a language that uses Chinese characters. - On the Advanced pane, make sure that the code pages you want to use are checked. -- Rainer Deyke - rainerd@eldwood.com |
June 29, 2009 Re: How to print Chinese characters in console in window XP? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Rainer Deyke | @Rainer Deyke: Thanks for your clarification. The problem is that, unless you set up your system to use Chinese for every non-unicode-ready application, systemwide and for all users, you will not get Chinese character output in the Windows console. The downside is that setting up your OS in such a way tends to render the user interface of a lot of other applications unusable if Chinese isn't your everyday language. For a lot of us this isn't very practicable, eg. having my German umlauts replaced with Chinese glyphs isn't exactly what I have dreamed of all my life. That's what I meant with the changes not being trivial, and your response sounded a bit like I was talking nonsense and getting it to work was a piece of cake, and I naturally was curious whether there was a simple solution. While being a bit disappointing, thanks for straightening out that this isn't the case. Nonetheless there apparently is a bug here if D/Phobos with its supposed unicode support isn't capable of producing output which is possible with Python or even olde C++. |
Copyright © 1999-2021 by the D Language Foundation