Would you please help us fix bar code letter question (EX:A300113111)? #96
Labels
No labels
api-inconsistency
automerge
bug
contributions welcome
documentation
duplicate
enhancement
good first issue
invalid
more-information-needed
question
sync
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
WhyNotHugo/python-barcode#96
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Would you please help us fix bar code letter question (EX:A300113111)?
import barcode from barcode.writer import ImageWriterstring='A300113111' ean = barcode.get('ean13',string, writer=ImageWriter())error:
raise IllegalCharacterError("EAN code can only contain numbers.")
barcode.errors.IllegalCharacterError: EAN code can only contain numbers.
As the error message says EAN13 barcodes can only contain decimal digits, the standard doesn't specify any mechanism for encoding non-digits symbols. If you want to encode letters, you need to use a different barcode format.
If you have a choice of format, try Code128 or Code39 if you need a 1-dimensional barcodes that can contain letters.