Skip to content

Conversation

@se-ti
Copy link

@se-ti se-ti commented Oct 6, 2022

One can easily test, that library draws wrong QR-codes for some special inputs like
new QRCode(elem "\x80");
new QRCode(elem, "\u0800"); // samaritan letter alaf
or any string, conatining chars with codes greater than 0xFFFF
new QRCode(elem, "🔥");

The reasons are

  • minor bounds check mistakes
  • string method charCodeAt never returns codes greater than 0xFFFF, so one of the branches of QR8bitByte is never used!

One should notice, that js support for unicode strings is pretty poor:
"🔥".length === 2, even though every human would say, this string has one 'character'.

P.S. qrcode.min.js should be updated also, i suppose, but i'm not sure which settings should be used, except smth like "preserve ie 6 compatibility"

@se-ti
Copy link
Author

se-ti commented Oct 9, 2022

@davidshimjs, could you please merge it, or reject, or smth else.

segdeha added a commit to segdeha/qrcodejs that referenced this pull request May 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant