0

I am unable to generate barcode(code39) for 'space' character. For example: "BAR CODE" I am passing it with = or _ or ~ symbols like below BAR_CODE BAR=CODE BAR~CODE

For all the above, getting an error as "Illegal character- Try using extended mode if you need to encode the full ASCII character set" Image of a stack trace Can you please suggest this.

Thanks& Regards, Ashok.

Mark Jeronimus
  • 9,278
  • 3
  • 37
  • 50
Ashok K
  • 1
  • 2
  • According to https://en.wikipedia.org/wiki/Code_39 the space is a legal character. The other symbols you try aren't. – Mark Jeronimus Mar 19 '19 at 13:25
  • Symbols `=`, `_`, and `~` are illegal in Code39, but space should work. Are you sure you use plain ASCII space, not one of Unitcode white space characters such as non-breakable space or figure space? – Mikhail Vladimirov Mar 19 '19 at 13:29
  • Be sure you are using UTF-8 and not UTF-16 for input. – Brian Anderson Mar 19 '19 at 23:12
  • Yes, the space is a legal character in code39. But I have tried with "BAR CODE" , it is encoding(using barbecue open source java library) for BAR only in pdf file. – Ashok K Mar 21 '19 at 05:36
  • If I Print BarCode for "BAR CODE" in pdf, problem exists.We are getting correct BarCode if i print it in html page. Any Idea on this? – Ashok K Mar 29 '19 at 09:21

1 Answers1

1

In my case, calling .ToUpper() on the barcode text, solved the problem.