Subject: | Incorrect check characters for Barcode93 |
I found the following happening while generating the barcode for the
value "494-5006".
In the calculateSums function, the checksum digits are calculated
correctly in a reverse order and are placed into the arrray:
'I', '(+)', '9', '0', '0', '5', '-', '4', '9', '4'
The error arises when the array is reversed and then --converted to a
string--. This is incorrect. After adding the *'s around the string, you
end up with a string of:
*494-5009)+(I*
You can see that this is a problem. Instead of using (+), it ends up
using only "+" (not "(+)" and that is the wrong character.
This -must- converted to it's binary representation as an array. The
update for the barcode() function is as follows. I have tested that this
works.
sub barcode {
my $self = shift;
my @sum_text = ('*', $self->calculateSums, '*');
my $return_string = '';
map { $return_string .= $code93bar->{$_} } @sum_text;
return $return_string . "1";
}
Additonally, the use of "*" as the start and stop character is partially
legitimate, but given that code 93 can -technically- encode any ASCII
character, that would need to be changed if Code 93 were to be used
outside of it's normal set of 47 characters, but since this module only
supports the basic 47 chars, that's a moot point. :)
Hopefully this will get into the main distribution.
Not that it changes anything, but I'm using perl 5.8.4 running under
debian linux (sarge and etch) on a 2.6 kernel.
--Joel