zint / zint-gpl-only

Zint Barcode Generator
https://zint.org.uk/
GNU General Public License v3.0
522 stars 137 forks source link

aztec encoding "Debug.Print" return wrong result #42

Closed Jonney3099 closed 2 years ago

Jonney3099 commented 10 years ago

My scanner read "DebugPrint" instead of "Debug.Print". I have no idea why you set 12 or 23 or 24 inside AztecCodeSet. they cause typemap(5)=88, 88-64=24 (curtable), we don't have such table with value =24. (only have 1,2,4,8,16 and 32) it cause ignore "." inside the string.

const int AztecCodeSet[128] = { /* From Table 2 */ 32, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 12, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 4, 4, 4, 4, 4, 23, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 24, 8, 24, 8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 8, 8, 8, 8, 8, 8, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 4, 8, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 8, 4, 8, 4, 4 };

/* Problem characters (those that appear in different tables with different values) can now be resolved into their tables / for(int i = 0; i < maplength; i++) { if((charmap[i] >= 300) && (charmap[i] < 400)) { curtable = typemap[i]; if(curtable > 64) { curtable -= 64; } switch(charmap[i]) { case 300: / Carriage Return / switch(curtable) { case PUNC: charmap[i] = 1; break; case MIXED: charmap[i] = 14; break; } break; case 301: / Comma / switch(curtable) { case PUNC: charmap[i] = 17; break; case DIGIT: charmap[i] = 12; break; } break; case 302: / Full Stop */ switch(curtable) { case PUNC: charmap[i] = 19; break; case DIGIT: charmap[i] = 13; break; } break; } } }

gitlost commented 2 years ago

The current version of Zint encodes "Debug.Print" correctly (as verified with ZXingC++). Thanks for the feedback. This fork is no longer in use so if you've any further questions please raise a ticket at https://sourceforge.net/p/zint/tickets/, thanks!