Report Fails to handle accented chars

Bug #537449 reported by Luis Manuel Angueira Blanco (Pexego)
90
This bug affects 13 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Status tracked in Trunk
5.0
Confirmed
Medium
Unassigned
Trunk
Fix Released
Medium
OpenERP's Framework R&D

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

Tags: maintenance

Related branches

summary: - Report non-ascii characters bugs
+ Report Fails to handle accented chars
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello ,

I would be interested to see the exact steps to face the error again.
With latest revisions, I failed to see it.

Thanks.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Thanks to Dukai,

He pointed us to this important ill-treatment to accented chars.

@subscribers,
Please follow the attached patched at https://bugs.launchpad.net/openobject-server/+bug/662598.

Thanks.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Apparently the poster says this bug is fixed in trunk by using the code for 5.0, so it does not seem to affect 5.0 - marking as Invalid in 5.0.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Assigning to framework team to double-check and properly validate this... seems that it's not completely working yet in trunk indeed.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Fix landed in server-trunk rev 2984 <email address hidden>

Thanks for the report(s)!

Revision history for this message
OpenBMS JSC (openbmsjsc) wrote :

it stills has problems with Unicode data in report headers: some unicode characters are showned as blackbox

Revision history for this message
OpenBMS JSC (openbmsjsc) wrote :
Revision history for this message
Don Kirkby (donkirkby) wrote :

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.

Revision history for this message
Thierry BAZIN (thierry-m-bazin) wrote :

I report the error in the bug #681801 where I had a error report instead of black box in the report.
In fact, this error occurs when it is necessary to translate some unicode characters in the header of the report, when, for example, the customer has his field "language" defined.

I changed the header/footer field to obtain manually the translation of the two words ""Mail" and "Phone" which are not automatically translated when the costumer has a defined language.

See the attached report, all word are in French, Phone and Mail stay in English.
"Quotation date" is not translated also.

tags: added: maintenance
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.