Issue 1712 in zxing: Codabar generator rejects ABCD as terminal symbols (or TN*E as start symbols)

72 views
Skip to first unread message

zx...@googlecode.com

unread,
Jun 17, 2013, 7:11:14 PM6/17/13
to zx...@googlegroups.com
Status: New
Owner: ----

New issue 1712 by vid...@google.com: Codabar generator rejects ABCD as
terminal symbols (or TN*E as start symbols)
http://code.google.com/p/zxing/issues/detail?id=1712

What steps will reproduce the problem?
1. Attempt to generate a Codabar code with value A31117013206375B


What is the expected output? What do you see instead?
As ABCD and TN*E are equivalent ways of specifying the same four symbols,
I would expect the code to generate the same bar code as A31117013206375N.

Instead, I get an IllegalArgumentException saying it has to end in TN*E.

What version of the product are you using? On what operating system?
Latest on Android.

Please provide any additional information below.

This seems to be purely a simple input validation problem.

CodaBarWriter.java lines 35-42 preemptively rejects them, while line 66+
would have encoded them the same.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

zx...@googlecode.com

unread,
Jun 18, 2013, 3:27:59 AM6/18/13
to zx...@googlegroups.com

Comment #1 on issue 1712 by srowen: Codabar generator rejects ABCD as
terminal symbols (or TN*E as start symbols)
http://code.google.com/p/zxing/issues/detail?id=1712

That's interesting. I don't know anything about Codabar, but
http://en.wikipedia.org/wiki/Codabar suggests that indeed ABCD are the
start and end chars, while sometimes TN*E are used. I suppose the simplest
thing is to require that the start and end are either all from the first
set, or all from the second? do you have any more specific reference?

zx...@googlecode.com

unread,
Jun 18, 2013, 3:38:30 AM6/18/13
to zx...@googlegroups.com

Comment #2 on issue 1712 by srowen: Codabar generator rejects ABCD as
terminal symbols (or TN*E as start symbols)
http://code.google.com/p/zxing/issues/detail?id=1712

(No comment was entered for this change.)

Attachments:
CodaBarWriter.patch 2.3 KB

zx...@googlecode.com

unread,
Jun 18, 2013, 5:28:18 AM6/18/13
to zx...@googlegroups.com

Comment #3 on issue 1712 by l.dob...@gmail.com: Codabar generator rejects
ABCD as terminal symbols (or TN*E as start symbols)
http://code.google.com/p/zxing/issues/detail?id=1712

The original poster seems to expect the two character sets to be mixable in
any form.
I.e.: start symbol from the ABCD set and end symbol in the TN*E set, but
also start and stop symbol from either set at the same time.
Reading the Wikipedia article I can see no reason no to allow that since A
== T, B == N, C == *, D == E. The article also states, that any of the 16
(4×4) combinations for start/stop characters is allowed, so there should be
no forced start-end matching.
A bit simpler patch attached.

Attachments:
CodaBarWriter.java.patch 2.2 KB

zx...@googlecode.com

unread,
Jun 18, 2013, 7:22:27 AM6/18/13
to zx...@googlegroups.com

Comment #4 on issue 1712 by srowen: Codabar generator rejects ABCD as
terminal symbols (or TN*E as start symbols)
http://code.google.com/p/zxing/issues/detail?id=1712

Good point, the result is the same, since the encoding of A and T match,
etc. Still I wonder if it's good to sense-check the argument. Even if
starting with A and ending with T will make the same barcode as starting
and ending with A, clearly the former is not allowed at the higher level of
interpretation, according to Wikipedia.

If anyone can provide a reference that would trump what's in Wikipedia I'd
go for the looser interpretation. Otherwise I kind of like being tighter.
Other references only mention A-D.

zx...@googlecode.com

unread,
Jun 18, 2013, 8:21:54 AM6/18/13
to zx...@googlegroups.com

Comment #5 on issue 1712 by l.dob...@gmail.com: Codabar generator rejects
ABCD as terminal symbols (or TN*E as start symbols)
http://code.google.com/p/zxing/issues/detail?id=1712

Unless the Wikipedia article is wrong:
... The 16 possible combinations of start and stop symbol may be used to
distinguish different applications...
The way I understand this is that any combination between any of the 4
start/stop characters is allowed: i.e. A???A is valid start/stop.

I've looked at the references in the article, and have seen no signals,
that it is not valid to use the same symbol for start/stop.
Admittedly I have no idea what would be the 'definitive source' for the
specification of Codabar.

zx...@googlecode.com

unread,
Jun 18, 2013, 9:00:52 AM6/18/13
to zx...@googlegroups.com

Comment #6 on issue 1712 by srowen: Codabar generator rejects ABCD as
terminal symbols (or TN*E as start symbols)
http://code.google.com/p/zxing/issues/detail?id=1712

Yes A???A is fine but I don't think A???T should be accepted as input, even
though the encoding would be the same because T and A are encoded in the
same way.

zx...@googlecode.com

unread,
Jun 18, 2013, 12:37:01 PM6/18/13
to zx...@googlegroups.com
Updates:
Status: Fixed
Owner: srowen
Labels: Type-Defect Priority-Medium

Comment #7 on issue 1712 by srowen: Codabar generator rejects ABCD as
terminal symbols (or TN*E as start symbols)
http://code.google.com/p/zxing/issues/detail?id=1712

Going with the current patch for now
Reply all
Reply to author
Forward
0 new messages