Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Are non-zero number systems allowed in UPC-E?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Koala  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 08:36
From: Koala <koalaatb81dot...@gmail.com>
Date: Thu, 5 Nov 2009 00:36:28 -0800 (PST)
Local: Thurs 5 Nov 2009 08:36
Subject: Are non-zero number systems allowed in UPC-E?
Dear Terry,

After searching via Google, I found that:

1. "A UPC-E barcode has 6 digits with an implied number system 0."
[http://www.morovia.com/education/symbology/upc-e.asp]

2. "UPC-E is a variation of the UPC-A symbol that is used for number
system 0."
[http://www.makebarcode.com/specs/upc_e.html]

3. In Wikipedia, the coding table showed only the number system 0
only.
[http://en.wikipedia.org/wiki/Universal_Product_Code#Zero-
compressed_UPC-E]

The upce ENCODER supports non-zero number systems. However, I've
tried to generate some upce barcodes with non-zero number systems
and used barcode readers/scanners (both software and hardware-based)
to recognize them. And neither could decode those barcodes.

So, are non-zero number systems allowed in UPC-E?
(How do they convert to corresponding UPC-A?)

If only leading 0 is allowed, how about changing the upce ENCODER to
accept 6 (or 7) digits and with an implied leading 0?

====
--- a/barcode.ps        2009-11-05 16:05:05.541225700 +0800
+++ b/barcode.ps        2009-11-05 13:01:05.399428300 +0800
@@ -1131,7 +1131,7 @@
 % --BEGIN ENCODER upce--
 % --SUGGESTS ean5 ean2--
 % --DESC: UPC-E
-% --EXAM: 0123456
+% --EXAM: 123456
 % --EXOP: includetext height=0.4
 % --RNDR: renlinear
 /upce {
@@ -1193,22 +1193,22 @@

     % Derive the equivalent UPC-A for its checksum
     /upcacode (00000000000) 11 string copy def
-    barcode 6 get 48 sub 2 le {
-        upcacode 1 barcode 1 2 getinterval putinterval
-        upcacode 3 barcode 6 1 getinterval putinterval
-        upcacode 8 barcode 3 3 getinterval putinterval
+    barcode 5 get 48 sub 2 le {
+        upcacode 1 barcode 0 2 getinterval putinterval
+        upcacode 3 barcode 5 1 getinterval putinterval
+        upcacode 8 barcode 2 3 getinterval putinterval
     } if
-    barcode 6 get 48 sub 3 eq {
-        upcacode 1 barcode 1 3 getinterval putinterval
-        upcacode 9 barcode 4 2 getinterval putinterval
+    barcode 5 get 48 sub 3 eq {
+        upcacode 1 barcode 0 3 getinterval putinterval
+        upcacode 9 barcode 3 2 getinterval putinterval
     } if
-    barcode 6 get 48 sub 4 eq {
-        upcacode 1 barcode 1 4 getinterval putinterval
-        upcacode 10 barcode 5 1 getinterval putinterval
+    barcode 5 get 48 sub 4 eq {
+        upcacode 1 barcode 0 4 getinterval putinterval
+        upcacode 10 barcode 4 1 getinterval putinterval
     } if
-    barcode 6 get 48 sub 5 ge {
-        upcacode 1 barcode 1 5 getinterval putinterval
-        upcacode 10 barcode 6 1 getinterval putinterval
+    barcode 5 get 48 sub 5 ge {
+        upcacode 1 barcode 0 5 getinterval putinterval
+        upcacode 10 barcode 5 1 getinterval putinterval
     } if
     /checksum 0 def
     0 1 10 {
@@ -1222,7 +1222,8 @@
     } for
     /checksum 10 checksum 10 mod sub 10 mod def
     /pad 8 string def
-    pad 0 barcode putinterval       % Add barcode to the start of the
pad
+    pad 0 48 put                    % Put implied zero to the start
of the pad
+    pad 1 barcode putinterval       % Add barcode next to the leading
zero
     pad 7 checksum 48 add put       % Put ascii for checksum at end
of pad
     /barcode pad def
     /txt 8 array def
@@ -1231,20 +1232,6 @@
     % Determine the mirror map based on checksum
     /mirrormap mirrormaps checksum get def

-    % Invert the mirrormap if we are using a non-zero number system
-    barcode 0 get 48 eq {
-        /invt mirrormap length string def
-        0 1 mirrormap length 1 sub {
-            /i exch def
-            mirrormap i get 48 eq {
-                invt i 49 put
-            } {
-                invt i 48 put
-            } ifelse
-        } for
-        /mirrormap invt def
-    } if
-
     /sbs 33 string def

     % Put the start character
@@ -1258,7 +1245,7 @@
         length /indx exch def          % indx is the length of pre
         pop pop                        % Discard seek and post
         /enc encs indx get def         % Get the indxth encoding
-        mirrormap i 1 sub get 49 eq {  % Reverse enc if 1 in this
position in mirrormap
+        mirrormap i 1 sub get 48 eq {  % Reverse enc if 0 in this
position in mirrormap
             /enclen enc length def
             /revenc enclen string def
             0 1 enclen 1 sub {


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Terry Burton  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 14:59
From: Terry Burton <t...@terryburton.co.uk>
Date: Thu, 5 Nov 2009 14:59:33 +0000
Local: Thurs 5 Nov 2009 14:59
Subject: Re: [postscriptbarcode] Are non-zero number systems allowed in UPC-E?

On Thu, Nov 5, 2009 at 8:36 AM, Koala <koalaatb81dot...@gmail.com> wrote:
> The upce ENCODER supports non-zero number systems. However, I've
> tried to generate some upce barcodes with non-zero number systems
> and used barcode readers/scanners (both software and hardware-based)
> to recognize them. And neither could decode those barcodes.

> So, are non-zero number systems allowed in UPC-E?
> (How do they convert to corresponding UPC-A?)

> If only leading 0 is allowed, how about changing the upce ENCODER to
> accept 6 (or 7) digits and with an implied leading 0?

Hi,

A non-zero number system is indeed undefined for UPC-E.

From a technical standpoint I think that your solution is fine,
however I have found in the past that designing the input in just such
a way results in confusion for the (non-technical) users of the
project.

I will however add a defensive check to ensure that the encoder fails
if a non-zero first character is given so that it no longer fails
silently.

All the best,

Terry


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Terry Burton  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 15:20
From: Terry Burton <t...@terryburton.co.uk>
Date: Thu, 5 Nov 2009 15:20:41 +0000
Local: Thurs 5 Nov 2009 15:20
Subject: Re: [postscriptbarcode] Are non-zero number systems allowed in UPC-E?

On Thu, Nov 5, 2009 at 2:59 PM, Terry Burton <t...@terryburton.co.uk> wrote:
> On Thu, Nov 5, 2009 at 8:36 AM, Koala <koalaatb81dot...@gmail.com> wrote:
>> The upce ENCODER supports non-zero number systems. However, I've
>> tried to generate some upce barcodes with non-zero number systems
>> and used barcode readers/scanners (both software and hardware-based)
>> to recognize them. And neither could decode those barcodes.
<...snip...>

> I will however add a defensive check to ensure that the encoder fails
> if a non-zero first character is given so that it no longer fails
> silently.

Done: http://code.google.com/p/postscriptbarcode/source/diff?spec=svn481&ol...

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google