Skip to content

Conversation

@neemevool
Copy link
Contributor

Description

Fixes issues with HIBC barcode parsing:

  1. Added null/whitespace check after stripping symbology identifier
  2. Added length check before accessing segmentData.First() to prevent IndexOutOfRangeException
  3. Commented out strict UnitOfMeasure validation for /Q segment (was causing false positives). The HIBC 2.3.2.4 is not so strict (should, not shall) as the current code is. I causes issues parsing even major vendors barcodes like 3M

Changes

  • ParseString(): Added validation after symbology identifier stripping
  • Case 'Q': Relaxed UnitOfMeasure requirement
  • Case '$': Added length validation before accessing characters

Testing

Tested with additional case and removed the test which intent was to trigger the exception

Copy link
Owner

@DacoTaco DacoTaco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@DacoTaco DacoTaco merged commit c0e26a7 into DacoTaco:main Jan 9, 2026
1 check passed
@DacoTaco
Copy link
Owner

DacoTaco commented Jan 9, 2026

version 0.1.9 has been pushed to nuget and is being processed @neemevool :)

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.

2 participants