| Reply | « Previous Thread | Next Thread » |
|
Hi!
When I use English in the statement like this note (u'Hello World!','info') It os OK. But when I use my national font. I have abrakadabra. note (u'ПРЕВЕД!','info') What I must do to get rigth the text for normal view? ![]() |
|
Ah, welcome to the wonderful world of character sets.
Python v2.3 introduced a way to select the source file encoding, like this: Code:
#!/usr/bin/python # -*- coding: utf8 -*- print u"<UNICODE CHARACTERS, ENCODED IN UTF-8>" Unfortunately this does not work in Python v2.2, which is the version Python for S60 has. Your editor probably uses UTF-8 or some national character set encoding. Python v2.2 expects ISO-8859-1 characters inside Unicode literals, so you cannot directly use text in your language inside Python for S60 programs. It needs to be expressed using unicode escapes: Code:
import appuifw appuifw.note(u"\u041f\u0420\u0415\u0412\u0415\u0414!", "info") More information about UTF-8: http://en.wikipedia.org/wiki/Utf-8 |
|
You can of course place the texts inside some other file, and read them from there: open("texts.txt").read().decode("utf-8")
|
| simo.salminen |
| View Public Profile |
| Find all posts by simo.salminen |
|
Thank u for professional help! It is work good.
![]() |
|
hi everybody
sorry for newbies question... would it work with arabic characters ? (on an n-gage) thanks bye bye ![]() |
|
this is works
but assume i want to write 1000 char by this way u041f\u0420\u0415\u0412\u0415\u0414 i will die before writing my program |
|
I think you should write (the arabic part) into a file and run a script to convert whatever is written in file to UTF-8.
Then just paste these into your PyS60 code. IDEAS is all they need but still they think only Genius can give them that. |
| shubhendra |
| View Public Profile |
| Find all posts by shubhendra |
|
So i tried this program and it is giving error
Code:
import appuifw abc=u"ПРЕВЕД" for c in abc: print ord(c) ERROR was Quote:
IDEAS is all they need but still they think only Genius can give them that. |
| shubhendra |
| View Public Profile |
| Find all posts by shubhendra |
|
And one more thing i noticed today was in both of my emulators,
S60 2nd edition FP2- wins udeb and S60 2nd edition FP2 (debug) and i am not able to display arabic characters beyond "U+064A" as note. Is there something wrong because i was looking at arabic unicode characters and they vary from U+0600 to U+06FF. http://en.wikipedia.org/wiki/Arabic_Unicode IDEAS is all they need but still they think only Genius can give them that. |
| shubhendra |
| View Public Profile |
| Find all posts by shubhendra |
|
if you wont write russian
Code:
def ru(dec):return dec.decode('utf-8')
Code:
print ru("привет")
|
|
hey look my problem is solved
i used PED 2.19 application then define my lang def arb(x):return x.decode('utf-8') arb('الصقر الذهبي') its work my interface of program now in arabic (^_^) |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| How to get the name of the used font | chrishawaii | Symbian User Interface | 1 | 2007-06-22 07:55 |
| Setting font in Series 60 | hariprasadth | Symbian User Interface | 3 | 2005-11-10 13:13 |
| Security code bug on 6230! | dabII | General Discussion | 1 | 2005-05-17 18:21 |
| New font 6600 | hamishw | General Symbian C++ | 0 | 2005-04-10 11:59 |
| Why is client code to CSocketEngine hanging at Access Point dialogue? | nawkboy | General Symbian C++ | 0 | 2003-02-24 05:00 |