Chinese Strings in Python

Reply

Join Date: May 2008
Posts: 2
Reputation: alasseon is an unknown quantity at this point 
Solved Threads: 0
alasseon alasseon is offline Offline
Newbie Poster

Chinese Strings in Python

 
0
  #1
May 13th, 2008
Hello, All:

My first post... I've looked high and low for the ability to write a Chinese language text string in a program.

For example:

myString = "你好"

So that if you say:

print myString

on the console you will see:

你好


But I have yet to be successful. First off, can Python do this, and second, what is the *easiest* way to make it happen? I'm certain I'm not the only one who would like to use Unicode in their source programs, or be able to process Unicode strings, but every article I've seen does it differently. Is there another language that will do this easily?

Surely, this is not difficult, is it?
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 2
Reputation: alasseon is an unknown quantity at this point 
Solved Threads: 0
alasseon alasseon is offline Offline
Newbie Poster

Re: Chinese Strings in Python

 
0
  #2
May 13th, 2008
Originally Posted by alasseon View Post
Hello, All:

My first post... I've looked high and low for the ability to write a Chinese language text string in a program.

For example:

myString = "你好"

So that if you say:

print myString

on the console you will see:

你好


But I have yet to be successful. First off, can Python do this, and second, what is the *easiest* way to make it happen? I'm certain I'm not the only one who would like to use Unicode in their source programs, or be able to process Unicode strings, but every article I've seen does it differently. Is there another language that will do this easily?

Surely, this is not difficult, is it?
Addendum:

While this was very difficult in Python 2.5, it is trivial in Python 3.0.
Using the print() function in Python 3.0 seems to print any combination of Chinese text that I throw at it.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Python Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC