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)

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)

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 milestone
No project
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
No description provided.