How to decode QRCode Image encoded with GBK

Feb 25, 2014 at 4:14 AM
Hi, I meet a problem as the subject. When I decode QRCode Image encoded with GBK, the result is messy.
I try this, but no effect
var hints = new Dictionary<DecodeHintType, Object>();
hints.Add(DecodeHintType.CHARACTER_SET, "gb2312");
var binarizer = new HybridBinarizer(luminance);
var binBitmap = new BinaryBitmap(binarizer);
Result result = reader.decode(binBitmap, hints);

Can someone tell me how to solve this? Thanks!
Feb 26, 2014 at 7:37 PM
Can you provide a sample QR code?
Anyway, the character set name is case sensitive and the library uses upper case. Please try "GB2312".
Jun 10, 2014 at 8:18 AM
Do you can work this? I have same problem.
GBK, gbk, gb2312, GB2312 all can't work.
use utf-8 can decode, but my QRCode is gbxxx.

help~ Thanks!
Jun 10, 2014 at 3:09 PM
Please provide a sample QR code which uses GB2312 and which can't be decoded.
Jun 11, 2014 at 5:02 PM
Is this can support code auto detect?
Jun 11, 2014 at 8:32 PM
There is a specification for QR codes which defines a default character set of ISO8859-1.
If the QR code uses a different encoding the encoder has to place an ECI segment before the first data codeword.
The ECI segment contains the identifier for the character set which is used. There is no auto detection needed
for correct encoded QR codes.

If you have trouble with a specific QR code please send me a sample image of them!
Jun 13, 2014 at 5:56 AM
This link is the pic of QR code.
Jun 16, 2014 at 8:21 PM
I can successfully decode the QR code. But you have to give a hint to the BarcodeReader class because there is no ECI segment inside the code.
Here is a small code snippet which decodes the image:
         var bitmapImage = (Bitmap)Bitmap.FromFile("MediaLib_Camera Roll_WP_20140613_001.jpg");
         var barcodeReader = new BarcodeReader
               Options = new DecodingOptions
                     CharacterSet = "GB2312",
                     TryHarder = true,
                     PossibleFormats = new List<BarcodeFormat> {BarcodeFormat.QR_CODE}
         var result = barcodeReader.Decode(bitmapImage);