This project has moved. For the latest updates, please go here.

QR Code Decoding Broken in Mono

May 7, 2012 at 1:44 AM

I can compile and use this project in a Windows environment.  Very well done.  Unfortunately, taking the exact same code (without modification) and decoding a QR Code in Mono on a Mac always returns null.  Other barcodes can be decoded successfully.

This is true using BarcodeReader, MultiFormatReader and QRCodeReader.  In all cases, the result is null.  For example, something as simple as this returns null for a picture-perfect QR code:

IBarcodeReader reader = new BarcodeReader ();
reader.TryHarder = true;
Bitmap bitmap = (Bitmap) Bitmap.FromFile("qrcodeimage.png");
Result result = reader.Decode(bitmap);

Any help would be greatly appreciated.  I'm unable to figure out what is causing the failure.  Thank you.

May 8, 2012 at 8:51 PM

I made a simple small fix which enables QR code decoding with mono.

The problem was the name of the encoding. Microsoft .Net support "ISO8859-1" and "ISO-8859-1" as the name of the encoding.
Mono supports only "ISO-8859-1". But I used "ISO8859-1" within

May 9, 2012 at 5:17 AM

Great news, thank you!  I'll give it a try and let you know if I see any other incompatibilities.