How can I get python to work with simplified Chinese text input either as strings or raw input?
input example: u = '世界您好!'still not working
JCR000
2010-04-18 02:48:48
string rather: = '世界您好!'
JCR000
2010-04-18 02:49:10
'gb2312' encoding and decodeing seems unavaile to my Python 2.6.5rc1 installation
JCR000
2010-04-18 03:01:23
I don't know what to tell you then. It's working fine here on 2.6.2. Perhaps there's another package you need to install in order to get the codec.
Ignacio Vazquez-Abrams
2010-04-18 03:13:15
I think on some Linux distros it mightn't be installed - you may need to install them from http://cjkpython.i18n.org/
David Morrissey
2010-04-18 03:17:42
Reverted back to python 2.6.2 and captured input with raw_input(). That works. Probably in 2.6.5 also but I did not try it.>>s = raw_input("Insert Chinese Text Here: ")你好世界>>u'\u4f60\u597d\u4e16\u754c'>> print s>> 你好世界
JCR000
2010-04-18 13:53:21
A:
Trivial handling of Chinese characters in python 2.6.2 32 bit on windows vista 64 bit
.>> s = raw_input("Insert Chinese Text Here: ")
你好世界
.>> u'\u4f60\u597d\u4e16\u754c'
.>> print s
你好世界
.>>
JCR000
2010-04-18 13:55:21