[Sugar-devel] gettext vs unicode problem in wireless key dialog

Gonzalo Odiard gonzalo at laptop.org
Mon Oct 8 18:15:33 EDT 2012


The fix applied is 5fdad9481ba7079a6a718159ebe7eb8e5367c46e
but of course only solve the problem with activities.
Probably we should apply the same change in sugar-session to solve this
issue.

Gonzalo

On Mon, Oct 8, 2012 at 6:31 PM, Daniel Drake <dsd at laptop.org> wrote:

> Hi,
>
> Sorry for not doing my homework, a bit overloaded...
> What was the result of the discussion where _("str1") % str2 was
> causing problems (assuming it has been resolved)?
>
> The issue I'm looking at is that we do this exact pattern in
> keydialog.py and it is raising an exception.
>
> The Spanish translation of str1 includes accents, and gettext returns
> it as a str. str2 is guaranteed to be unicode. And this is an unhappy
> combination:
>
> >>> "fóo%s" % u"bar"
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
> 1: ordinal not in range(128)
>
>
> If posting a fix is easier than replying to this mail, please do so :)
> The string is: A wireless encryption key is required for the wireless
> network '%s'
>
> Thanks
> Daniel
> _______________________________________________
> 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/20121008/7ca69ca1/attachment.html>


More information about the Sugar-devel mailing list