I accidently answered my own question while trying to ask this one. But incase someone else was trying to solve the same problem or had issues finding a solution:
Annex - A.4 Protocol used to encode ASCII in GS1 DataMatrix, shows how to convert the rawbyte values according to their guideline.
I'm working on a project for GS1 datamatrix barcodes in context of pharmacy labels. I'm using ZXing and Camera MAUI.
In general, I want to be able to parse the information into it's labelling format:
GTIN(01): (N14) //fixed length of numeric digit.
SN(21): (X..20)
LOT(10): (X..20)
EXP(17): (N6)
Nn = Numeric digit of fixed length of n
X..n = Alphanumerical of variable length n
reference: Guideline chapter 2.2
Example 01076123456789001710050310AC3453G321455777
01 07612345678900 17 00503 10 50310AC3453G3 21 455777
or how it should ideally be read due to the FNC1 characters. Some of the information given is fixed so it's easy to separate those. But parsing for the variable length is an issue.
from what I understand, there are FNC1 characters embedded into the barcode to help separate them. However, the results I get from the camera doesn't seem to show the FNC1 characters. Based on what I've already tried, I'm assuming it's in the intermediary steps, where the barcode reader is parsing the FNC1 characters and removing them before the results are returned.
I've researched other questions asked by others:
a clue maybe unescaping characters
7yrs old. looked promising but didn't work.
but for some reason, I could not parse the FNC1 characters.
Looking at the ZXing library, ZXing contains a Result class that returns an array of bytes. according to this chapter 2.2.1
The FNC1 (codeword 232) using 0109504000059101211906781181110563GS117200331
I get an array of byte values: 232,131,139,180,170,130,135,221,131,151,149,136,208,141,211,50,232,140,186,52,72,84,50,232,147,150,133,161,129,45 How do I convert these values? I know the 232 is probably the FNC1 representation in rawbytes. I got desperate and tried asking ChatGPT on how to convert FNC1 characters from rawbytes. But now that I'm typing all this out and looking at my references again, I just realized I answered my own question. Sorry for the trouble.