From: <ro...@zi...> - 2012-05-30 08:15:19
|
Hi, After a long time of not even looking at Zint I have had another look at this and can confirm that John is absolutely right and I was wrong. I have made an adjustment to the code so that this should be available in the next release. In the meantime if you're comfortable with editing and re-compiling then below is the adjustment to the code required to make this work. Robin. diff --git a/backend/aztec.c b/backend/aztec.c index db148bd..b583f82 100644 --- a/backend/aztec.c +++ b/backend/aztec.c @@ -80,7 +80,7 @@ int aztec_text_process(unsigned char source[], const unsigned int src_len, char charmap[maplength] = 400; typemap[maplength++] = PUNC; } else { - if(source[i] > 127) { + if((source[i] > 127) || (source[i] == 0)) { charmap[maplength] = source[i]; typemap[maplength++] = BINARY; } else { @@ -685,14 +685,6 @@ int aztec(struct zint_symbol *symbol, unsigned char source[], int length) break; } - /* Aztec code can't handle NULL characters */ - for(i = 0; i < length; i++) { - if(local_source[i] == '\0') { - strcpy(symbol->errtxt, "Invalid character (NULL) in input data"); - return ERROR_INVALID_DATA; - } - } - err_code = aztec_text_process(local_source, length, binary_string, gs1); On 07 November 2011 at 09:04 Stuart Prior <stu...@ig...> wrote: > Hi Robin, > > I noticed that a John Luebs replied on the 31st of September with: > > "This is not quite correct. The B/S (byte shift) state of Aztec is 8-bit > clean. Shifting to B/S, and then a length of 1, followed by the > encodation of 0*8 will encode a NUL byte. Granted, the minimum length > for this sequence is not very nice: 18 bits (not including stuffing)." > > Is it possible for someone attached to the Zint project to implement his > suggestion? Or do I post it as a bug and hope it gets fixed in the next > release? > Kind Regards, > Stuart. > > On 10 Oct 2011, at 18:32, ro...@zi... wrote: > > > Hi, > > > > I'm afraid the Aztec code standard simply doesn't support the encoding NULL > > characters. This is a deficiency in the standard rather than a problem with > > Zint. If your message needs to include NULL then you will need to use a > > different barcode standard. > > > > Robin. > > > > > > On 10 October 2011 at 11:23 Stuart Prior <stu...@ig...> wrote: > > > > > Hello, > > > > > > I'm trying to create an AZTEC barcode with binary data containing null > > > characters with version 2.4.3 of zint lib. > > > > > > Zint complains that AZTEC can't handle null characters. I've tried setting > > > the input mode to DATA_MODE but this still doesn't work > > > > > > How can I get zint to generate a barcode with null characters? Do I have > > > to encode it? Do i simply replace null characters with spaces before > > > passing the binary to zint? > > > > > > Thanks in advance for any help. > > > > > > scp. > > > > > > -- > > > This message is confidential to the addressee. Any copying or distribution > > > of it by anyone without the addressee's consent may be unlawful. If you > > > are not the intended addressee, please inform us immediately by reply and > > > then delete this message. Any dissemination or copying of this message and > > > its contents and any disclosure or use of the information transmitted is > > > strictly prohibited without our prior written consent. > > > > > > Igence Ltd, Ladycross Farm, Hollow Lane, Dormansland, Surrey RH7 6PB > > > +44(0)1342 872032 (Direct) > > > +44(0)1342 870800 > > > > > > http://www.igence.com/ > > > > > > Registered in England and Wales: 3829804 > > > > > > > > > > > > > > > > > -- > > This message is confidential to the addressee. Any copying or distribution of > it by anyone without the addressee's consent may be unlawful. If you are not > the intended addressee, please inform us immediately by reply and then delete > this message. Any dissemination or copying of this message and its contents > and any disclosure or use of the information transmitted is strictly > prohibited without our prior written consent. > > Igence Software Ltd, The Barn, Lady Cross Business Park, Hollow Lane, > Dormansland, LINGFIELD, Surrey, RH7 6PB > +44(0)1342 872 032 (Direct) > +44(0)1342 870800 http://www.igence.com/ > > Registered in England and Wales: 3829804 > |