[Python-bugs-list] [ python-Bugs-563915 ] getttext defaults with unicode

noreply@sourceforge.net noreply@sourceforge.net
Tue, 04 Jun 2002 02:28:17 -0700


Bugs item #563915, was opened at 2002-06-03 17:09
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=563915&group_id=5470

Category: Unicode
Group: Python 2.2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Rikard Anglerud (anglerud)
Assigned to: M.-A. Lemburg (lemburg)
Summary: getttext defaults with unicode

Initial Comment:
When using gettext, and a token is not translated, for
example:
print _('Foo')
the output will be 'Foo', as expected. 
However, if that entry is:
print _(u'Foo')
we get:
Traceback (most recent call last):
  File "./translation.py", line 12, in ?
    print _(u'Foo')
  File "/usr/lib/python2.2/gettext.py", line 195, in
ugettext
    return unicode(tmsg, self._charset)
TypeError: decoding Unicode is not supported

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2002-06-04 11:28

Message:
Logged In: YES 
user_id=21627

I'm not sure this is a bug: they keys in a message catalog
are really byte strings. So it is an error to use Unicode
strings as arguments to _.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=563915&group_id=5470