File tree Expand file tree Collapse file tree 2 files changed +20
-6
lines changed
Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -246,12 +246,18 @@ protected function getHighLevelEncoding(string $data): array
246246 }
247247
248248 while ($ pos < $ data_length ) {
249- // Determine if current char is FNC1 (don't encode it, just pass it through)
250- if ($ this ->gsonemode && ($ data [$ pos ] == \chr (232 ))) {
251- $ cdw [] = 232 ;
252- ++$ pos ;
253- ++$ cdw_num ;
254- continue ;
249+ if ($ this ->gsonemode ) {
250+ // check for control characters
251+ $ cco = \ord ($ data [$ pos ]);
252+ if (
253+ $ cco == 232 // FNC1 (ASCII 232 - HEX \xE8)
254+ || $ cco == 29 // <GS> (ASCII 29 - HEX \x1D)
255+ ) {
256+ $ cdw [] = $ cco ; // don't encode, just pass it through.
257+ ++$ pos ;
258+ ++$ cdw_num ;
259+ continue ;
260+ }
255261 }
256262
257263 switch ($ enc ) {
Original file line number Diff line number Diff line change @@ -423,8 +423,16 @@ public static function getGridDataProvider(): array
423423 ],
424424 [
425425 'DATAMATRIX,S,GS1,C40 ' ,
426+ // \xE8 is the control character FNC1 (ASCII 232)
426427 "\xE8" . '01095011010209171719050810ABCD1234 ' . "\xE8" . '2110 ' ,
427428 'ba117111dfa40a40e1bb968c719d2eef '
429+ ],
430+ [
431+ 'DATAMATRIX,S,GS1 ' ,
432+ // \xE8 is the control character FNC1 (ASCII 232)
433+ // \x1D is the control character <GS> (ASCII 29)
434+ "\xE8" . '01095011010209171719050810ABCD1234 ' . "\x1D" . '2110 ' ,
435+ 'cc096c94e0e2d88e8c50e3fdccef60ce '
428436 ]
429437 ];
430438 }
You can’t perform that action at this time.
0 commit comments