Barcode could be UPC or EAN but definitely not a number

Musicbrainz contain “Barcode” (picard use it as tag) no matter whether it is UPC (12 digit) or EAN (13 digit).

In addition, the name “Barcode” in its actual form is not a number.

The existing “Barcodes” had to be sorted by length and then renamed EAN and UPC.

I would be pleased to receive suggestions and opinions.

1 Like

In principle, barcodes are the printed black and white bars, which can be read by a barcode reader and displayed as a 13-digit string or a 12-digit string in case the first number would otherwise be 0 - thus it can have leading zeros, which would be gone when stored as a number.

On the other hand, barcodes were always used to store/refer to product numbers and a leading 0 makes no different product anyway.

Digital media have no bars but may have any number of leading zeros displayed in addition to the actual number.

Maybe we would be happy with a number, displayed with at least 12 digits, but we would lose the difference between UPC and EAN (printed human-readable barcodes, the bars are the same) and “digital barcodes” …although I’m not sure if this data is well maintained. :grin:

3 Likes

I am not sure this helps.

From AI: “A barcode contains a number, specifically a unique string of digits that represents a product. These numbers are used to identify the product in a database and retrieve information about it.”

In my own database I store it as a text string because a leading zero would be striped off and you would have no idea if it was UPC or EAN. When I import to a spreadsheet I have to take care that it imports as text which is a real pain. I call it a number with leading zeros intact.

In the DB there are some number of UPC’s entered as EAN’s, which I fix when I find them, so be careful where the data comes from. Almost all UPC’s in eBay are entered a EAN with a leading zero.

As to sorting it may depend on the application doing the sort. I will need to test sorting a text string of numbers as text and number.

1 Like