Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Python Unicode Bug
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
regomodo
Guru
Guru


Joined: 25 Mar 2008
Posts: 445

PostPosted: Wed Oct 07, 2009 2:02 pm    Post subject: [solved] Python Unicode Bug Reply with quote

Hi, i'm developing an Amarok-1.4 clone and I have a weird issue going on in Gentoo with Unicode. It seems to complain about code that shouldn't.

Code:
>>> a = "Bj\xc3\xb6rk"
>>> b = a.decode("utf-8")
>>> print b
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 2: ordinal not in range(128)
>>>


However, whenever I run the same on Ubuntu this is what I get:

Code:
>>> a = "Bj\xc3\xb6rk"
>>> b = a.decode("utf-8")
>>> print b
Björk


What is causing the error in Gentoo?


Last edited by regomodo on Wed Oct 07, 2009 2:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
regomodo
Guru
Guru


Joined: 25 Mar 2008
Posts: 445

PostPosted: Wed Oct 07, 2009 2:35 pm    Post subject: Reply with quote

Solved it. I didn't have "LANG="en_GB.UTF-8"" in /etc/env.d/02locale
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum