Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Encoding a string in 128c barcode symbology

Tags:

java

barcode

I am having some trouble with encoding this string into barcode symbology - Code 128.

Text to encode: 1021448642241082212700794828592311

I am using the universal encoder from idautomation.com: https://www.bcgen.com/fontencoder/

I get the following output for the encoded text for Code 128: Í*5LvJ8*r5;ÂoP<[7+.Î

However, in ";Âo" the character between the semi-colon and o (let us call it special A) - is not part of the extended character set used in Code128. (See the Latin Supplements at https://www.fonts2u.com/code-128.font)

Yet the same string shows a valid barcode at https://www.bcgen.com/linear-barcode-creator.html

How?

If I use the output with the Special A on a webpage with a font face for barcodes, the special A character does not show up as the barcode (and that seems correct since the special A is not part of the character set).

What gives? Please help.

I am using the IDAutomation utility to encode the string to 128c symbology. If you can share code to do the encoding (in Java/Python/C/Perl) that would help too.

like image 889
Mayank R Jain Avatar asked Jan 14 '14 15:01

Mayank R Jain


1 Answers

There are multiple fonts for Code128 that may use different characters to represent the barcode symbols. Make sure the font and the encoding logic match each other.

I used this one http://www.jtbarton.com/Barcodes/Code128.aspx (there is also sample code how to encode it on the site, but you have to translate it from VB). The font works for all three encodings (A, B and C).

like image 161
Durandal Avatar answered Oct 01 '22 11:10

Durandal