tc-lib-barcode
tc-lib-barcode copied to clipboard
Datamatrix-encoding of special character
I'm trying to encode the special "trademark"-character (™) into a datamatrix code. The character has the ASCII-number 226 so it is within the ASCII specification for datamatrix (1-255).
The generated datamatrix-code looks like this:
Which, when decoded just gives weird characters, depending on the decoder sometimes several chars sometimes just a question mark.
No I'm confused whether this is some kind of multibyte (?) problem or if the character is just not supported (even though within the allowed range). I have tried online encoders and received conflicting results, e.g. this generator (https://products.aspose.app/barcode/de/generate) will encode and decode the character correctly while a different decoder will also show weird characters when decoding the image generated with this encoder. Different encoders like this one (https://barcode.tec-it.com/de/DataMatrix) will not encode the character at all but display an error message that invalid characters have been entered.
So my question is: Is ™ supported at all (according to the specs it should) and what do I need to do to generate it correctly? e.g. use/convert to a different character set? Also: Would it be possible to throw an execption in datamatrx if characters that are not supported are trying to be generated? (Like it is already done with C128: If I try to encode the trademark-sign here, I receive the message "Error: Invalid character sequence: 226")