[Sugar-devel] Unicode strings in translations

Alan Jhonn Aguiar Schwyn alanjas at hotmail.com
Mon Aug 13 16:23:15 EDT 2012


I have problems too..
I load the strings from a file, and have that problems (even the file is UTF-8).
My solution: when load a string, convert it:
name_converted = unicode(name, 'UTF-8')

> From: martin.langhoff at gmail.com
> Date: Mon, 13 Aug 2012 16:00:31 -0400
> To: humitos at gmail.com
> CC: sugar-devel at lists.sugarlabs.org
> Subject: Re: [Sugar-devel] Unicode strings in translations
> 
> On Mon, Aug 13, 2012 at 12:35 PM, Manuel Kaufmann <humitos at gmail.com> wrote:
> > To get Unicode strings from gettext I had to put these lines in my
> > lesssonscreen.py file:
> >
> > import gettext
> > gettext.install('po', unicode=True)
> 
> Awright. Seems like gettext hasn't realized that it's 2012 and
> defaults to using codepages.
> 
> I'd vote for gettext.install('po', unicode=True) everywhere. All Sugar
> builds have been in the utf-8 era, so this should work even in
> extremely old builds.
> 
> 
> 
> 
> m
> -- 
>  martin.langhoff at gmail.com
>  martin at laptop.org -- Software Architect - OLPC
>  - ask interesting questions
>  - don't get distracted with shiny stuff  - working code first
>  - http://wiki.laptop.org/go/User:Martinlanghoff
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20120813/0046b3af/attachment.html>


More information about the Sugar-devel mailing list