You Are Here:

Community: Developer Discussion Boards

#1 Old No codec search function... what does it mean?? - 2006-11-05, 18:02

Join Date: Sep 2006
Posts: 2
stboss@tin.it
Offline
Registered User
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
googleing around the net I was able to find that this code generate the same error:

Code:
"abcd".encode('raw-unicode-escape')
what does it mean? I miss importing some libraries??
Please could explain me where is the bug so I can fix it? (I am a python newby :-)

thanks,
Stefano
Reply With Quote

#2 Old Re: No codec search function... what does it mean?? - 2006-11-06, 08:34

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
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
Reply With Quote

#3 Old Re: No codec search function... what does it mean?? - 2006-11-06, 19:12

Join Date: Sep 2006
Posts: 2
stboss@tin.it
Offline
Registered User
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
is the point on the pickle.py library where eveything blow-up!
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')
to reproduce the error and try to find out the solution. These sentences of code works perfectly on my linux box without importing any library; so I was wondering how to avoid the problem and letting the pickle library to work!
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
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
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

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia