← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 537449] Re: Report Fails to handle accented chars

 

I'm getting the same black boxes in my reports. I see it when I have
Unicode characters in database fields.

Example:
1. Create a sales order quotation.
2. Fill out enough fields to save it.
3. Edit the sales order notes field and include some Chinese characters. (I expect any other multibyte Unicode characters would behave the same.)
4. Click the Quotation / Order button to generate the report PDF.
5. I expect to see the Chinese characters in the note, but I see black boxes instead. The single byte characters in the same field all appear normal. My black boxes look the same as the screen shot from Phong Nguyen.

I'm testing on Ubuntu 10.04 using OpenERP 5.15.

** Changed in: openobject-server/5.0
       Status: Invalid => New

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/537449

Title:
  Report Fails to handle accented chars

Status in OpenObject Server:
  Fix Released
Status in OpenObject Server 5.0 series:
  New
Status in OpenObject Server trunk series:
  Fix Released

Bug description:
  Hi,

When you try to print a report (RML) with non-ascii characters, like in the string 'día', you get an error that says that can't decode the character.:

   File "/opt/openerp/trunk_pxgo/server/bin/report/render/rml2pdf/utils.py", line 109, in _process_text
   result += unicode(self.localcontext.get('translate', lambda x:x)(sps.pop(0)))
   UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128)

Looking at the stable version (5.0), there is a difference:
            result += tools.ustr(self.localcontext.get('translate', lambda x:x)(sps.pop(0)))
instead of 5.2:
            result += unicode(self.localcontext.get('translate', lambda x:x)(sps.pop(0)))

is this okay? i've tried to change the methods and I've got success (importing previusly "tools").

sorry for the explanation