Skip to content

Commit 67ed487

Browse files
committed
Codablock F: more fixes and tests
1 parent 701bfc3 commit 67ed487

File tree

7 files changed

+58
-12
lines changed

7 files changed

+58
-12
lines changed

src/main/java/uk/org/okapibarcode/backend/CodablockF.java

+5-12
Original file line numberDiff line numberDiff line change
@@ -357,15 +357,13 @@ private void data_encode_blockf() {
357357
input_position++;
358358
done = true;
359359
}
360-
361360
if ((findSubset(inputData[input_position]) == Mode.SHIFTB) && (c == 1)) {
362361
/* Needs two symbols */
363362
blockmatrix[current_row][column_position] = 100; /* Code B */
364363
column_position++;
365364
c--;
366365
done = true;
367366
}
368-
369367
if ((inputData[input_position] >= 244) && (!done)) {
370368
/* Needs three symbols */
371369
blockmatrix[current_row][column_position] = 100; /* Code B */
@@ -378,7 +376,6 @@ private void data_encode_blockf() {
378376
}
379377
done = true;
380378
}
381-
382379
if ((inputData[input_position] >= 128) && (!done) && c == 1) {
383380
/* Needs two symbols */
384381
blockmatrix[current_row][column_position] = 100; /* Code B */
@@ -395,15 +392,13 @@ private void data_encode_blockf() {
395392
input_position++;
396393
done = true;
397394
}
398-
399395
if ((findSubset(inputData[input_position]) == Mode.SHIFTA) && (c == 1)) {
400396
/* Needs two symbols */
401397
blockmatrix[current_row][column_position] = 101; /* Code A */
402398
column_position++;
403399
c--;
404400
done = true;
405401
}
406-
407402
if (((inputData[input_position] >= 128)
408403
&& (inputData[input_position] <= 159)) && (!done)) {
409404
/* Needs three symbols */
@@ -417,7 +412,6 @@ private void data_encode_blockf() {
417412
}
418413
done = true;
419414
}
420-
421415
if ((inputData[input_position] >= 160) && (!done) && c == 1) {
422416
/* Needs two symbols */
423417
blockmatrix[current_row][column_position] = 101; /* Code A */
@@ -434,7 +428,6 @@ private void data_encode_blockf() {
434428
c--;
435429
done = true;
436430
}
437-
438431
if (((findSubset(inputData[input_position]) == Mode.ABORC)
439432
&& (findSubset(inputData[input_position + 1]) != Mode.ABORC))
440433
&& (c == 1)) {
@@ -444,7 +437,6 @@ private void data_encode_blockf() {
444437
c--;
445438
done = true;
446439
}
447-
448440
if (inputData[input_position] >= 128) {
449441
/* Needs three symbols */
450442
blockmatrix[current_row][column_position] = 101; /* Code A */
@@ -455,6 +447,7 @@ private void data_encode_blockf() {
455447
column_position++;
456448
c--;
457449
}
450+
done = true;
458451
}
459452
break;
460453
}
@@ -587,7 +580,7 @@ private void data_encode_blockf() {
587580
c--;
588581
if (inputData[input_position] >= 128) {
589582
/* Extended ASCII character */
590-
blockmatrix[current_row][column_position] = 100; /* FNC4 */
583+
blockmatrix[current_row][column_position] = 101; /* FNC4 */
591584
column_position++;
592585
c--;
593586
}
@@ -602,7 +595,7 @@ private void data_encode_blockf() {
602595
c--;
603596
if (inputData[input_position] >= 128) {
604597
/* Extended ASCII character */
605-
blockmatrix[current_row][column_position] = 100; /* FNC4 */
598+
blockmatrix[current_row][column_position] = 101; /* FNC4 */
606599
column_position++;
607600
c--;
608601
}
@@ -632,7 +625,7 @@ private void data_encode_blockf() {
632625
c--;
633626
if (inputData[input_position] >= 128) {
634627
/* Extended ASCII character */
635-
blockmatrix[current_row][column_position] = 101; /* FNC4 */
628+
blockmatrix[current_row][column_position] = 100; /* FNC4 */
636629
column_position++;
637630
c--;
638631
}
@@ -647,7 +640,7 @@ private void data_encode_blockf() {
647640
c--;
648641
if (inputData[input_position] >= 128) {
649642
/* Extended ASCII character */
650-
blockmatrix[current_row][column_position] = 101; /* FNC4 */
643+
blockmatrix[current_row][column_position] = 100; /* FNC4 */
651644
column_position++;
652645
c--;
653646
}
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
PROPERTIES
2+
3+
content=2610\u00F2
4+
5+
LOG
6+
7+
Grid Size: 4 X 2
8+
K1 Check Digit: 51
9+
K2 Check Digit: 38
10+
Encoding: MODEC 0 26 10 101 100 (86) MODEB 11 100 82 51 38 (100)
11+
Blocks Merged: 59 -> 49
12+
13+
CODEWORDS
14+
15+
2114121131412122223212212213123111411141314112122331112
16+
2114121141312312121141311212412131131323111141312331112
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
PROPERTIES
2+
3+
content=*\r\xF2\x82\x82(\x982\x82\x82*\r\xF2\x82\xA8\x82\x82\x82\x82
4+
5+
LOG
6+
7+
Grid Size: 7 X 7
8+
K1 Check Digit: 4
9+
K2 Check Digit: 76
10+
Encoding: MODEB 69 10 101 77 100 100 82 101 (8) MODEA 11 101 66 101 66 8 101 88 (51) MODEC 44 100 18 101 101 66 101 66 (32) MODEB 13 10 101 77 100 100 82 101 (102) MODEA 14 101 66 101 8 101 66 100 (85) MODEA 15 101 66 101 66 101 66 100 (23) MODEA 26 100 101 100 101 100 4 76 (80)
11+
Blocks Merged: 267 -> 175
12+
13+
CODEWORDS
14+
15+
2114121141311122142213123111414131111141311141311212413111411322122331112
16+
2114124113112312123111411214213111411214211322123111414212112131132331112
17+
2114121131411321311141312232113111413111411214213111411214212321212331112
18+
2114121141311221322213123111414131111141311141311212413111414111312331112
19+
2114124113111222313111411214213111411322123111411214211141311242112331112
20+
2114124113111132223111411214213111411214213111411214211141313121312331112
21+
2114124113113212211141313111411141313111411141311213222211141112422331112
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
PROPERTIES
2+
3+
content=\u0018\u00F2
4+
5+
LOG
6+
7+
Grid Size: 4 X 2
8+
K1 Check Digit: 56
9+
K2 Check Digit: 48
10+
Encoding: MODEA 64 88 100 100 82 (28) MODEA 11 100 101 56 48 (53)
11+
Blocks Merged: 59 -> 49
12+
13+
CODEWORDS
14+
15+
2114124113111114224212111141311141311212413221122331112
16+
2114124113112312121141313111413311213131212131312331112

0 commit comments

Comments
 (0)