Datamatrix code encoding error
I have encountered an error regarding the datamatrix code generation. When trying to encode the string 002K6-24.BTPA.1 to datamatrix, the resulting code will actually encode 002K6-24.BTV82
This happens even with the most recent version of the code (datamatrix.php 1.0.008).
I won't expect a fix since this repo is obsolete but want to warn everybody that you cannot trust the datamatrix generator.
The error does not arise when the string after the last dot is slightly longer, i.e. 002K6-24.BTPA.10 but does trigger when the last part has different content and the content after the last dot is only one digit i.e. 002K6-24.AXERT.1
I believe this happens because the encoding changes when approaching the last dot, then the lookahead failes dues to some reason. I already tried replacing all "and" and "or" statements by && and || to avoid any kind of unintuitive operator precedence, but to no avail. I also checked the symbattr table and it looks fine. I suspect the logic that messes this up to be located in the getHighLevelEncoding function.
If anybody has solved this riddle, I'd be glad to hear about it.
@chross see https://github.com/w512work/TCPDF/commit/aa86f9248d668e6287f9d395f20c3c5c64c1516f
Please re-open since #678 is not merged yet
You are right, my bad. The fix works, though.