Code128 - Code set identification?

22 views
Skip to first unread message

Green72

unread,
Apr 30, 2015, 11:57:48 AM4/30/15
to zx...@googlegroups.com
Hi,

Trying to solve a problem with our labelprinters, we detected that some printers printa certain barcode in codeset A, another in B and another even in the C codeset.

Your program always identifies all barcodes as "CODE128", eventhough it decodes perfectly.

Could this information be displayed? There is no program in the android market that does give this info.

I am aware that you can switch between codesets inside the barcode, but thats not the question.

Sorry if I ask a stupid question.
Thanks for a great program.

Bas Vijfwinkel

unread,
Apr 30, 2015, 11:57:21 PM4/30/15
to zx...@googlegroups.com
According to the specification, all three code sets can be used in a single barcode.
In order to display this information you need to analyze the raw data once more
and see which codesets have been used.
>> To represent all 128 ASCII values, there are three code sets (A, B, C), which can be mixed within a single barcode (by using codes 98 and 99 in code sets A and B, 100 in code sets A and C and 101 in code sets B and C to switch between them)

Currently the codeset information is being detected but it is not saved in the scan Result object.
I checked the source and the detection which codeset is used is present so in order to have this information displayed you should store it somewhere in the Code128Reader and pass it back with the Result object.
https://github.com/zxing/zxing/blob/master/core/src/main/java/com/google/zxing/oned/Code128Reader.java#L247

The Result object has a property for metadata which can hold information like the codeset. When displaying the type of barcode, you could use the metadata property information to show this additional information.
https://github.com/zxing/zxing/blob/master/core/src/main/java/com/google/zxing/Result.java

Sean's app has much more features than the free app so it might be that he already shows it but you'd have to ask him.




Reply all
Reply to author
Forward
0 new messages