Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datamatrix code encoding error #674

Open
chross opened this issue Jan 11, 2024 · 3 comments
Open

Datamatrix code encoding error #674

chross opened this issue Jan 11, 2024 · 3 comments

Comments

@chross
Copy link

chross commented Jan 11, 2024

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.

@w512work
Copy link

@chross see w512work@aa86f92

@chross chross closed this as completed Jan 23, 2024
@williamdes
Copy link
Contributor

Please re-open since #678 is not merged yet

@chross chross reopened this Jan 23, 2024
@chross
Copy link
Author

chross commented Jan 23, 2024

You are right, my bad. The fix works, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants