mono0926 / barcode_scan2

[reborned barcode_scan] A flutter plugin for reading 2D barcodes and QR codes.
https://pub.dev/packages/barcode_scan2
MIT License
87 stars 77 forks source link

[Bug] Consider UPCA as EAN13 #31

Open mchlkng88 opened 3 years ago

mchlkng88 commented 3 years ago

BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

Describe the bug When you scan a 12-digit UPC_A barcode, Codescan recoginaze it as EAN13 and pad a '0' at the begin of rawContent.

For example: UPC_A 096619663712, it will be returned as 0096619663712 in the format of EAN13.

To Reproduce Scan

Expected behavior return 096619663712 instead of 0096619663712

Screenshots If applicable, add screenshots to help explain your problem. 159

Logs If applicable, add the verbose output of flutter run.

Environment (please complete the following information):

Additional context Add any other context about the problem here.

MrTavus commented 2 years ago

Hi, there is any solution for this bug?

ChaoQunPeng commented 3 months ago

Apple has done these treatments, please refer to the link below.

My solution is to remove the preceding 0 if the barcode is 13 digits and the first digit is 0.

https://stackoverflow.com/questions/22767584/ios7-barcode-scanner-api-adds-a-zero-to-upca-barcode-format https://developer.apple.com/library/archive/technotes/tn2325/_index.html#//apple_ref/doc/uid/DTS40013824-CH1-IS_UPC_A_SUPPORTED_

jesdav18 commented 2 weeks ago

Apple has done these treatments, please refer to the link below.

My solution is to remove the preceding 0 if the barcode is 13 digits and the first digit is 0.

https://stackoverflow.com/questions/22767584/ios7-barcode-scanner-api-adds-a-zero-to-upca-barcode-format https://developer.apple.com/library/archive/technotes/tn2325/_index.html#//apple_ref/doc/uid/DTS40013824-CH1-IS_UPC_A_SUPPORTED_

Confirmo que esta solución me ha funcionado.

I confirm that this solution has worked for me.