1
0
Fork
You've already forked python-barcode
0

Would you please help us fix bar code letter question (EX:A300113111)? #96

Open
opened 2020年11月25日 10:33:17 +01:00 by yipingliu0402 · 1 comment
yipingliu0402 commented 2020年11月25日 10:33:17 +01:00 (Migrated from github.com)
Copy link

Would you please help us fix bar code letter question (EX:A300113111)?

import barcode from barcode.writer import ImageWriter

string='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.

Would you please help us fix bar code letter question (EX:A300113111)? `import barcode from barcode.writer import ImageWriter` `string='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.
lieryan commented 2020年11月26日 23:35:29 +01:00 (Migrated from github.com)
Copy link

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.

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.
Sign in to join this conversation.
No Branch/Tag specified
main
pre-commit-ci-update-config
extensibility
fix_sizes
feature/longer_guard_bar
ean-without-checksum
readme-formatting
cleaning
cleanup
srolin/master
michieldwitte/left-alignment-fix
v0.13.1
v0.13.0
v0.12.0
v0.11.0
v0.10.0
v0.9.0
v0.8.3
v0.8.2
v0.8.1
v0.8.0
0.8beta1
0.7
0.7beta4
0.7beta3
0.7beta2
v0.6
v0.6b3
v0.6b2
v0.6b1
v0.5.0
v0.5.0b1
v0.4.3
v0.4.2
v0.4.1
v0.4
v0.4b2
v0.4b1
v0.3
v0.3b1
v0.2.1
v0.1
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
WhyNotHugo/python-barcode#96
Reference in a new issue
WhyNotHugo/python-barcode
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?