Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.perl.modules > #207

Re: Imager::QRCode-ing octet sequences vs. zbarimg(1)

From Ivan Shmakov <oneingray@gmail.com>
Newsgroups comp.lang.perl.modules, comp.lang.perl.misc, alt.barcodes
Subject Re: Imager::QRCode-ing octet sequences vs. zbarimg(1)
Date 2013-03-17 17:57 +0000
Organization Aioe.org NNTP Server
Message-ID <87txo9j4d5.fsf@violet.siamics.net> (permalink)
References <87ehfjmst4.fsf@violet.siamics.net> <u0m61a-t5i1.ln1@anubis.morrow.me.uk>

Cross-posted to 3 groups.

Show all headers | View raw


>>>>> Ben Morrow <ben@morrow.me.uk> writes:
>>>>> Quoth Ivan Shmakov <oneingray@gmail.com>:

 >> I wonder if QR codes are suitable for encoding arbitrary octet
 >> sequences (AKA 8-bit data)?  I've tried the following Perl code, but
 >> it appears that the resulting transformations aren't "8-bit clean."
 >> Somehow, I suspect a QR::Imager fault, although zbarimg(1) may be
 >> responsible.  (Unfortunately, the Perl module itself doesn't provide
 >> a decoder.)

 > There is a Perl decoder based on zbar (Barcode::ZBar), though
 > presumably it would behave the same as zbarimg.

	... Indeed it does, which made me file Debian Bug#703234 [1].

	Now, however, given that the Wikipedia article mentions
	ISO-8859-1 as the default (?) encoding for 8-bit QR codes, the
	issues zbarimg(1) and Barcode::ZBar have may be considered
	separately.

	Taking into account that different symbologies may (and do) use
	different character to code mappings, it may be sensible for
	libzbar to recode the barcode read into an UTF-8 string.  Better
	still is that Perl supports UTF-8 as its native character string
	representation.  What's wrong, however, is that the UTF-8 string
	returned by libzbar to Perl is not properly marked as such, thus
	resulting in the observed (and incorrect) behavior.

	(The obvious workaround is to Encode::decode_utf8 () the
	symbol's data returned by ->get_data ().)

	OTOH, zbarimg(1) should probably respect the current locale's
	encoding, instead of using UTF-8 unconditionally.

[1] http://bugs.debian.org/703234

[...]

-- 
FSF associate member #7257

Back to comp.lang.perl.modules | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Imager::QRCode-ing octet sequences vs. zbarimg(1) Ivan Shmakov <oneingray@gmail.com> - 2013-03-13 11:40 +0000
  Re: Imager::QRCode-ing octet sequences vs. zbarimg(1) Ben Morrow <ben@morrow.me.uk> - 2013-03-13 16:27 +0000
    bytes, English, and prototypes Ivan Shmakov <oneingray@gmail.com> - 2013-03-13 17:28 +0000
    Re: Imager::QRCode-ing octet sequences vs. zbarimg(1) Ivan Shmakov <oneingray@gmail.com> - 2013-03-14 20:25 +0000
    Re: Imager::QRCode-ing octet sequences vs. zbarimg(1) Ivan Shmakov <oneingray@gmail.com> - 2013-03-17 17:57 +0000
      Re: Imager::QRCode-ing octet sequences vs. zbarimg(1) Ben Morrow <ben@morrow.me.uk> - 2013-03-18 23:42 +0000
        [OT] reporting bugs Ivan Shmakov <oneingray@gmail.com> - 2013-03-30 11:02 +0000
          Re: reporting bugs Ben Morrow <ben@morrow.me.uk> - 2013-04-01 22:58 +0100
            Re: reporting bugs Ivan Shmakov <oneingray@gmail.com> - 2013-04-06 13:50 +0000
          configuring CPAN to apply patches (such as #29468, IPv6 in Net::HTTP) Ivan Shmakov <oneingray@gmail.com> - 2013-06-28 19:48 +0000

csiph-web