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

How to support Chinese Hanzi? (QRCode)

Jul 12, 2012 at 1:44 AM
Edited Jul 12, 2012 at 1:45 AM

How to support Chinese Hanzi?  (QRCode)

Tks!

Coordinator
Jul 12, 2012 at 6:04 AM

Hanzi support is built-in. BUT I couldn't test it yet.

Please provide some more information. What doesn't work for you?

Please send me a sample barcode which doesn't decode correctly (and the expected result).

Jul 13, 2012 at 1:18 AM

Now,It can work correctly

 change source code (in file qrcode/encode/encoder.cs)

internal static String DEFAULT_BYTE_MODE_ENCODING = "ISO-8859-1";   

into

internal static String DEFAULT_BYTE_MODE_ENCODING = "utf-8";

 

 

Tks!

Coordinator
Jul 13, 2012 at 6:44 AM

That isn't the correct way.

If you do so you would change the default character set for QR Code encoding. That is against the specifications.
Latin-1 / ISO-8859-1 is defined as the default character set for QR Codes.

If you want a different one you can use a hint while calling the encoder/decoder.

var hints = new Dictionary<EncodeHintType, object>();
hints.Add(EncodeHintType.CHARACTER_SET, "UTF-8");
Encoder.encode(content, ecLevel, hints);