[reportlab-users] Code 39 Check digit bug ?
icottee at bluefountain.com
Fri Jul 3 06:01:02 EDT 2009
Using reportlab2.2, with python2.5 on Mac OSX
from reportlab.graphics.barcode import code39
In : bc1 = code39.Extended39('48281450412')
In : bc1.validate()
In : bc1.encode()
That check digit of '*' appears to be wrong. Our clients can't scan
the code and the docs would appear to say that it should be a '$'.
Using the code from Wikipedia at
charset = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%"
return st + charset[ sum(charset.index(c) for c in st) % 43 ]
In : append_c39_checksum('48281450412')
Is this a known issue or a misunderstanding on my part? It only
appears to happen when the checkdigit sum is 39. We have the same
result on the clients system which is running Ubuntu 8.04
Blue Fountain Systems Ltd
More information about the reportlab-users