This question is somewhat related to the following topic:
I am trying to create a data matrix barcode component of a special format. It must contain Seperators and End of Line characters. Specifically I need Chr(4), Chr(29), and Chr(30) to be inside my expression.
Apparently this is no problem for a data matrix, you can easily set it in code:
F.e. the code below will add a text with with the code points you asked to a barcode component (which can be configured as datamatrix.
Do note that printing these will give mixed results (f.e. check the difference between printing the string directly, or the representation of the string). So scanning it will also give mixed results.
s = "test codes: \004 \029 \030 "
print s
print repr(s)
event.source.parent.getComponent('Barcode').code = s
When I add the special characters to my barcode and Print it out I can’t figure out how to test to see if the characters will be read in. Because notepad text input would not show the seperators. Is there any software out there I can download that will read a data matrix in character by character so I can verify it works?
You are providing the escape codes in octal, and repr() is delivering them in hexadecimal (\x). However, \029 isn’t valid octal, so it is interpreted as octal \02 and a separate character ‘9’. I suggest you uniformly use hexadecimal so there is no confusion.