← Back to team overview

c2c-oerpscenario team mailing list archive

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

 

Hi. Now am puzzled about how to read this symbol in OpenERP. For example, i set focus on the product field of some order/stock move/lot and read this barcode that consists of a few fields.
I tried to rewrite name_seach function to parse RE like r'^10(?P<lot>\d+)'+chr(29) to distinguish product code field.
Seems it just doesn't see <GS> symbol.
Do you have any idea?

-- 
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