Ok, this one was really annoying: I’m using the MessagingToolkit to create dynamic QR-codes. Sometimes my application threw an exception, because an “Index was outside the bounds of the array”. Because of the complex scenario, it was pretty hard to track down this error. Adding the following lines to my code solved the problem:
//create encoder object MessagingToolkit.QRCode.Codec.QRCodeEncoder qe = new MessagingToolkit.QRCode.Codec.QRCodeEncoder(); //set error correction level to Q = 25% qe.QRCodeErrorCorrect = MessagingToolkit.QRCode.Codec.QRCodeEncoder.ERROR_CORRECTION.Q; //here comes work-around #1 qe.QRCodeVersion = 0; //here comes work-around #2, using utf8 Bitmap bmp = qe.Encode(encodedText, System.Text.Encoding.UTF8);
I really like this library, it’s very easy to work with and does exactly what i was looking for. But it would be great if they could fix this bug.