Hi.

I still have problem with reports.
This time it's the issue with localized strings evaluated from expressions.
In example 'invoice.rfxml' form you have expression like:
     "%s %s %s" % (self.duedate.day, self.duedate.strftime("%b"), 
self.duedate.year)

If I understand code well, we need pass unicode string to function in line
1338:             func(posx, 0, s)

But what happens in lines 1331-1335?
Purpose of encode() method (if I read documentation properly), is to convert
unicode string to plain Python string.
To convert plain string to unicode, decode() method should be used, 
isn't it?
Here is actual code:
                 try:
                     s = s.encode(self.Encoding)
                 except UnicodeDecodeError:
                     # s must have already been encoded, and the default 
encoding is ascii.
                     pass

I simply changed this code to:
                 try:
                     s = s.decode(self.Encoding)
                 except UnicodeEncodeError:
                     # s must have already been encoded, and the default 
encoding is ascii.
                     pass

and now all localized strings works properly for me.

-- 
Regards
Jacek Kałucki

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to