Problem with Code128 encoder with " | " and newline

May 9, 2014 at 4:19 AM
Hi
I've requirement to encode the following text to be barcode (using code128)
"|A10193
10009122"

these text contain both special character(" | ") and control code ("<CR>+<LF>")
I try to use zxing.net to encode but it will show error when i try to send "|A10193\r\n10009122" to encode. From the source code, I found that the encode part is not support for code128A which contains control code. But on the decode part it support all subset A,B,C.
Coordinator
May 9, 2014 at 7:49 PM
First, you are right, codeset A isn't supported in the encoder at the moment.
Second, one question: What do you mean with "special character(" | ")"? It's a normal character for me (in codeset B).
What is your expected behaviour of the encoder if it found that character?
May 11, 2014 at 4:52 PM
hi micjahn

My expectation is when i send "|A10193\r\n10009122" to encode it should encode with codeset B
then it could switch to codeset A at "\r\n" because Code 128 allows multiple variants, as well as switching between variants within a single barcode.
but i've create my own 128 which could encode codeset A,B,C and allow switching between varients within a single barcode. I use the barcode specification from
http://en.wikipedia.org/wiki/Code_128 and it works. now I just replace the code128 encoder of zxing with my own. I would like to share the code to zxing. Could it be possible to add this code into the project.

the things I've done is
  • code128 encoder that allow switching between variants within a single barcode.
  • Barcode length optimization (shorter barcode using code 128c)
Coordinator
May 11, 2014 at 6:22 PM
Ofcourse, patches are always welcome.
You can send me patches via email or you upload it in the source code area in the patches section.