From 4dc5f1abaca83fae4acc38c7bce69e04661d85ed Mon Sep 17 00:00:00 2001 From: "srowen@gmail.com" Date: Wed, 20 Mar 2013 22:00:30 +0000 Subject: [PATCH] Handle Code 128 FNC1 according to GS1-128 git-svn-id: https://zxing.googlecode.com/svn/trunk@2592 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- core/src/com/google/zxing/oned/Code128Reader.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/src/com/google/zxing/oned/Code128Reader.java b/core/src/com/google/zxing/oned/Code128Reader.java index 07db7c77e..13753a525 100644 --- a/core/src/com/google/zxing/oned/Code128Reader.java +++ b/core/src/com/google/zxing/oned/Code128Reader.java @@ -322,6 +322,15 @@ public final class Code128Reader extends OneDReader { } switch (code) { case CODE_FNC_1: + if (result.length() == 0){ + // GS1 specification 5.4.3.7. and 5.4.6.4. If the first char after the start code + // is FNC1 then this is GS1-128. We add the symbology identifier. + result.append("]C1"); + } else { + // GS1 specification 5.4.7.5. Every subsequent FNC1 is returned as ASCII 29 (GS) + result.append((char) 29); + } + break; case CODE_FNC_2: case CODE_FNC_3: case CODE_FNC_4_A: