4

I'm quite new to zxing and the barcode standards. I'm now developing an Android application using zxing-android-embeded with zxing-core version 3.2.0. When I was trying to read some EAN-13 code(in Japan it's JAN-13, the standard should be similar I think) begin with zero, but I found the zero was lost. For example, the origin code is:

0200004410007

But what I got in the app is:

200004410007

Besides, when I was using the zxing APP in the GooglePlay, the result is also 200004410007.

Could any please tell me why the the first "0" was lost? Also, if I need to read it as same as the original one, is that necessary to add the "0" by myself?

---Update---

I've tried to get the format of barcode result using:

result.getBarcodeFormat();

What I've got is "UPC-A", which means when I was scanning a barcode encoded by EAN-13, but zxing regarded it as UPC-A. Is that a bug in zxing?

MeowAlien
  • 81
  • 6

1 Answers1

4

Um, I think I found the question here, although it may be not so relevant:

The UPC-A is a subset of EAN-13, any EAN-13 start with 0 will be regarded as UPC-A, which is 12 digits without the leading 0.

Wikipedia pages here

So that's means I need to convert the UPC-A back to EAN-13 again. Or one of the violence and stupid way is just add a zero for a UPC-A format. Thanks for your attention, and hope this will help.

MeowAlien
  • 81
  • 6