Swedish letter in QR code
mishanon opened this issue · comments
Try to generate QR code, try add Swedish letter and got wrong QR code (with red pixels LOL)
generateQR("Övrigt asdasd asdas djaskl djaslk djaslkj dlaiodqjwiodjaskldj aksldjlk Övrigt")
func generateQR(QRText string) {
qrc, err := qrcode.New(QRText)
if err != nil {
fmt.Printf("could not generate QRCode: %v", err)
}
// save file
if err := qrc.Save("qr.png"); err != nil {
fmt.Printf("could not save image: %v", err)
}
}
what happened ... orz, give me some time to figure out
@mishanon after some tests, this bug would be triggered while input content is more than 74 characters, it's not related to the character set (Swedish), but I don't locate the bug in the source code yet. I will keep working on it. In my oppinion, it's version's
bug...
There is a bug while the raw content's length and error-correcting level require a higher version (6+):
- I didn't code all QR Code version alignment patterns.
- the function
fillVersionInfo
which works onlyversion 7+
didn't work as QR Code specification.
By the way, this library didn't support Kanji encoding
and all after it, https://en.wikipedia.org/wiki/QR_code#Encoding, but Byte encoding
supports ISO-8859 character set which includes Swedish
letters.
Thanks for your feedback.