| Reply | « Previous Thread | Next Thread » |
|
Hi to all you guys,
I found out a strange bug, I think related with unicode. Writing this code I have an error: Code:
def load_unicode(self):
self.append(unicode(self.readline()[:-1],'raw-unicode-escape'))
dispatch[UNICODE] = load_unicode
Code:
LookUpError: no codec search functions registered: can't find encoding Code:
"abcd".encode('raw-unicode-escape')
Please could explain me where is the bug so I can fix it? (I am a python newby :-) thanks, Stefano |
| stboss@tin.it |
| View Public Profile |
| Find all posts by stboss@tin.it |
|
Hi stboss@tin.it and welcome to the forum!
Fighting with encoding can give big headaches Let's start from the beginning: what exactly are you willing to do? The default encoding on the phone is as you probably know UTF-8 . You now need to know what is the encoding applied to the data you want to display in UTF-8: ASCII, UTF8 itself... This, in order to use the right codec for the conversion. LFD Devices: Nokia E61 3rd Edition - pys60 1.4.0 Tips and modules: http://www.lfdm.net/thesis |
|
Ok let me better explain my problem.
What I'm really doing is try to port the pickle.py code on my nokia N80. I'm trying to do this because this library is used by a software (mnemosyne, open source flash card software) I'm trying to port on my mobile. The code Code:
def load_unicode(self):
self.append(unicode(self.readline()[:-1],'raw-unicode-escape'))
dispatch[UNICODE] = load_unicode
The pickle code is trying to reloading a txt database (it's just a txt file with a lot of fields). Reading around I fonud that somo other guys had the same problem with python for non x86 architecture; and one of them suggest to use: Code:
"abcd".encode('hex')
I don't know if the two pieces of code are relate but they give me the same error! Thanks a lot for your help, Stefano |
| stboss@tin.it |
| View Public Profile |
| Find all posts by stboss@tin.it |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| please give us a CALENDAR SEARCH function!!! | peppeverdi | General Discussion | 6 | 2009-09-09 07:26 |
| 请哪位好心人告诉我几个 Navigation key 的keyCode的宏定义 | daijuntang | Symbian | 9 | 2006-03-30 09:36 |
| search function in the forum | biffir | Symbian Networking & Messaging | 0 | 2003-11-24 09:41 |
| Cannot compile SDK's examples for 7650 platform... | midletsoft | Symbian Tools & SDKs | 2 | 2003-08-12 20:11 |
| Problem with Nokia D211 Linux Drivers | fiveam | Multimodecards | 1 | 1970-01-01 02:00 |