How to print Chinese characters in console in window XP?

Rainer Deyke rainerd at eldwood.com
Sat Jun 27 15:13:03 PDT 2009


Elrood wrote:
> Sorry to have to disappoint you, but Chinese output to a Windows console
> is non-trivial if not entirely impossible (you'd probably have to ask
> someone using a Chinese Windows version for a definitive answer).

No, it's not.  In Python, unicode text output just plain works.

Program:
  # coding=utf-8
  print u'中国'
Output:
  中国

This is a bug in D, full stop.

(Yes, you do need to to set a codepage that contains these characters (I
am using CP932) and you need an font that can represent these
characters.  I assume OP already has both.  Note that CP65001 does not
work.)


-- 
Rainer Deyke - rainerd at eldwood.com


More information about the Digitalmars-d-learn mailing list