← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 664345] Re: Non-ASCII characters not supported in RML barcodes

 

vrsb, reading the data will be another problem, I propose we keep this bug report focused on writing the barcode in RML.
If your data is a GS1-128 or EAN-128 barcode: I wrote an exhaustive module to read and decode GS1-128 data, we can discuss it here : http://www.openerp.com/forum/topic18131.html.
Lionel

-- 
Non-ASCII characters not supported in RML barcodes
https://bugs.launchpad.net/bugs/664345
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.

Status in OpenObject Server: Confirmed

Bug description:
Hello.
I make an RML report with barcode of "code128 " kind.
Is there a way to insert a special FNC1 symbol (field delimeter) in the barcode? This is required this because there are fields of variable length in barcode.

The Reportlab documentation says: "Code 128 is a very compact symbology that can encode the entire 128 character ASCII set, plus 4 special control codes, (FNC1-FNC4, expressed in the input string as \xf1 to \xf4)."

So Python code like "bar=code128.Code128("\xf412\xf134567890",xdim=100*mm)" works well.

But when i try to insert this symbol between <barCode> an </barCode> inside RML template i get:
File "reportlab\platypus\doctemplate.pyo", line 756, in build
  File "reportlab\platypus\doctemplate.pyo", line 649, in handle_flowable
  File "reportlab\platypus\frames.pyo", line 159, in _add
  File "reportlab\platypus\flowables.pyo", line 121, in wrap
  File "reportlab\graphics\barcode\common.pyo", line 107, in width
  File "reportlab\graphics\barcode\common.pyo", line 57, in _calculate
  File "reportlab\graphics\barcode\code128.pyo", line 243, in validate
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf1 in position 0: ordinal not in range(128)

Tried to insert it many ways: &#241; ñ; [['\xf1']] or [[u'xf1']]

I think something is wrong in trml2pdf.py... it transmits an unicode string where should be "simple" one





References