skip2 / go-qrcode

:sparkles: QR Code encoder (Go)
http://go-qrcode.appspot.com
MIT License
2.64k stars 338 forks source link

UTF 8 support? #41

Open qaywsx22 opened 4 years ago

qaywsx22 commented 4 years ago

Please, encode this string "one two три четыре fünf sechs" and decode the resulting code. Last four words are decoded incorrectly. The same thing happens if you encode this line in your example on your test site http://go-qrcode.appspot.com/

skip2 commented 4 years ago

https://stackoverflow.com/questions/1612062/unicode-encoding-and-decoding-issues-in-qrcode might help. QR codes don't have a builtin UTF-8 encoding (just raw bytes). It seems prefixing the content with a byte order mark helps decoder software get the right encoding.

qaywsx22 commented 4 years ago

Thanks for the quick response. Unfortunately, the addition of BOM helped only partially. I can encode up to 3 letters "ö", then up to six letters does not work correctly. Starting with the seventh letter, it works every second time (7, 9, 11 ...).

Edit: I found the source of the problem. The library works, the problem was with my QR-Code scanner App. You can close the ticket.