hid-barcode-scanner icon indicating copy to clipboard operation
hid-barcode-scanner copied to clipboard

DataMatrix code with special characters is not transmitted correctly

Open healthiiHelmut opened this issue 9 months ago • 6 comments

I scan a DataMatrix code from a pack of medicine and I see a different code in the app than the one transmitted via Bluetooth. Unfortunately, the "Raw Value" setting did not help either.

image

image

The text arrives via Bluetooth as "010415005024809221102784642637491725123110NN1814" (without the character between 49 and 17).

healthiiHelmut avatar May 08 '24 11:05 healthiiHelmut

Hi, thank you for your report. When I scan the code, there is no space shown for me between the 49 and 17. Is the space for you also there if you view it from the history page?

Fabi019 avatar May 08 '24 14:05 Fabi019

Hi, thank you for your report. When I scan the code, there is no space shown for me between the 49 and 17. Is the space for you also there if you view it from the history page?

Using another scanner I was able to confirm the space between the 49 and 17. I will look into it why it isn't transmitted.

Fabi019 avatar May 08 '24 14:05 Fabi019

Using another scanner I was able to confirm the space between the 49 and 17. I will look into it why it isn't transmitted.

It looks like the missing character is a group seperator (ascii 0x1D). There are two instances of this in the code, at the beginning and in the middle ("010415005024809221102784642637491725123110NN1814"). Unfortunately it is not directly possible to type this character with a keyboard. That is why it is currently simply ignored during transmission.

What I could do instead, is to add a new option to the settings that would allow to specify a character/string that will be used as a fallback for non-typable characters (e.g. space). Let me know if that would help you or if you have other ideas!

Fabi019 avatar May 10 '24 10:05 Fabi019

Hi, thanks for checking!

Perhaps transferring the raw value of the barcode as a Base64 or HEX string would be an easy option? Then the receiving application would be guaranteed to have all the information from the barcode.

healthiiHelmut avatar May 13 '24 10:05 healthiiHelmut

Perhaps transferring the raw value of the barcode as a Base64 or HEX string would be an easy option? Then the receiving application would be guaranteed to have all the information from the barcode.

That's also a good idea. The easiest way to implement this for now, would probably be as a new custom template e.g {CODE_HEX} for hex and {CODE_B64} for base64 encoding.

Fabi019 avatar May 13 '24 17:05 Fabi019

That sounds great! It would be wonderful if the feature could be implemented.

healthiiHelmut avatar May 14 '24 08:05 healthiiHelmut