| Reply | « Previous Thread | Next Thread » |
|
I use chinese language in "appuifw.query(u"你好","text")",but it is not nomail.
How i can use in it? THANKS! |
|
I got this question also, anyone can help me?
Maybe most of friends on the board can not see chinese chars : "你好" yet, so they can not understand what I ask? |
|
Quote:
PyS60 is Python v2.2. Python v2.2 only supports ISO 8859-1 ("ISO Latin-1") characters in Unicode string literals. For example, this works when the file is saved in ISO 8859-1 ("ö" is ISO-8859-1 character number 246 or 0xf6 in hex): Code:
import appuifw appuifw.note(u"Böö!", "info") Unicode characters outside the eight bit ISO 8859-1 range must be represented as Unicode escapes in string literals. There are several posts about this in the forum: http://discussion.forum.nokia.com/fo...d.php?t=101549 http://discussion.forum.nokia.com/fo...ad.php?t=83710 So, to print "你好", you must use u"\u4f60\u597d" in your program. |
|
Quote:
I have a low-level question : how can I get u"\u4f60\u597d" from "你好" in python? -_-||| Thanks. |
|
Quote:
a) How was I able to determine which Unicode escapes represent the characters "你" and "好"? or b) Can you include Chinese characters as-is in the Python source code and if yes, how? I'll answer both questions. a) I copied the two chinese characters to a Unicode-aware text editor and saved to a file using UTF-8 encoding. Then, I read the file in a Python program on my PC, decoded the UTF-8 encoding and printed the resulting Unicode escapes, like this: Code:
print repr(file("test.txt").read().decode("utf8"))
Code:
import appuifw
appuifw.note("你好".decode("utf-8"), "info")
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Chinese character encoding | chandlersee | Other Programming Discussion 关于其他编程技术的讨论 | 3 | 2004-11-11 14:04 |
| How do I get Chinese language into my 6230? | fssia | General Discussion | 2 | 2004-10-02 03:58 |
| 7250i chinese language? | apollo333 | Web Technologies and Multimedia Content- Web 技术和多媒体内容 | 1 | 2004-02-02 04:29 |
| About S60 Chinese MIDP SDK Chinese language support | zhaolikang | Mobile Java General | 0 | 2004-01-09 03:38 |
| Chinese file encoding. | fmhunter | Other Programming Discussion 关于其他编程技术的讨论 | 2 | 2003-06-30 04:29 |