Message1458
Same problem appears also if you create a string using pattern like 'Something %s' and the substituted string is unicode. Examples below demonstrate.
Jython 2.2b1 on java1.5.0_10 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> x = 'Good %s' % u'Hyv\u00E4'
>>> type(x)
<type 'str'>
>>> x
'Good Hyv\xE4'
>>> unicode(x)
Traceback (innermost last):
File "<console>", line 1, in ?
UnicodeError: ascii decoding error: ordinal not in range(128)
>>>
Python 2.4.3 (#1, May 18 2006, 07:40:45)
[GCC 3.3.3 (cygwin special)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> x = 'Good %s' % u'Hyv\u00E4'
>>> type(x)
<type 'unicode'>
>>> x
u'Good Hyv\xe4'
>>> unicode(x)
u'Good Hyv\xe4'
>>>
|
|
Date |
User |
Action |
Args |
2008-02-20 17:17:43 | admin | link | issue1659819 messages |
2008-02-20 17:17:43 | admin | create | |
|