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

Enable different initial encoding for datamatrix #86

Conversation

flaviencrochard
Copy link
Contributor

Description

Datamtrix can be fully encoded with different encoding. The actual parameters in constructor don't allow that for now.

For instance :
$data = "IS010000000000000000000000S1173082622170111S21.2.250.1.213.1.4.10S3JEAN-MICHEL" . chr(29) . "S4INS-FAMILLE-UN" . chr(29) . "S5MS607-08-1973S726221";

I nned to fully encode that string in C40 (not related to the chr(29) aka GS character)

So here is this pull request to add a third parameter in constructor to set the initial encoding, according to the constant declared in Data class.

Examples :

DATAMATRIX,S / DATAMATRIX,S,N,0 => datamatrix square in ASCII encoding
DATAMATRIX,S,N,1 => datamatrix square in C40 encoding
DATAMATRIX,R,N,5 => datamatrix square in BASE256 encoding

I noticed than on master branch, the test "Test\BarcodeTest::testGetPng" is broken : filename expected isn't correct. So i couldn't check the first item in the checklist
...

Checklist:

  • The make buildall command has been run successfully without any error or warning.
  • Any new code line is covered by unit tests and the coverage has not dropped.
  • Any new code follows the style guidelines of this project.
  • The code changes have been self-reviewed.
  • Corresponding changes to the documentation have been made.
  • The version has been updated in the VERSION file.

Type of change:

  • Bug fix (non-breaking change which fixes an issue) → The patch number in the VERSION file has been increased.
  • New feature (non-breaking change which adds functionality) → The minor number in the VERSION file has been increased.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) → The major number in the VERSION file has been increased.
  • Automation.
  • Documentation.
  • Example.
  • Testing.

@CLAassistant
Copy link

CLAassistant commented Aug 23, 2024

CLA assistant check
All committers have signed the CLA.

This change includes a new feature
@nicolaasuni
Copy link
Member

@flaviencrochard
Thank you for your contribution.
I manually merged this PR and refactored it to use strings instead of integers:
#87

@nicolaasuni nicolaasuni closed this Sep 5, 2024
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

Successfully merging this pull request may close these issues.

3 participants