Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Archived:How to enter non-ascii character in PySymbian

From Wiki
Jump to: navigation, search

Archived.pngAquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.

Article Metadata
Created: cyke64 (19 Mar 2007)
Last edited: hamishwillee (31 May 2013)

Smartphone doesn't have a non-ascii input method. You can buy a special software to do it but you can use Python also. You do a 2-level popup menu to let people choose from the character table.

Here's an example for Thai characters but you make it for other language you just change the unicode offset (0x0e01) and number of characters (77) to that of your language. One requirement for this method is that the phone must be able to display font in your language already. An alternative method to implement this will be manually drawing your text (combine character from image font file).

# example with thai characters
from appuifw import *
def thai_input():
first_list = [' '.join(thai_char[i:i+11]) for i in range(0,77,11)]
y = popup_menu(first_list, u'select Thai char')
if y is not None:
x = popup_menu(thai_char[11*y:11*(y+1)], u'select Thai char')
if x is not None:
t.add(thai_char[11*y + x])
thai_char = [unichr(0x0e01+i) for i in range(77)] # 77 thai characters
app.body = t = Text() = [(u'thai', thai_input), (u'clear screen', t.clear)]
# wait for user to exit program
import e32
lock = e32.Ao_lock()
This page was last modified on 31 May 2013, at 01:03.
32 page views in the last 30 days.