Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non UTF-8 characters make the qrcode invalid #266

Open
agijbels opened this issue Jan 7, 2022 · 6 comments
Open

Non UTF-8 characters make the qrcode invalid #266

agijbels opened this issue Jan 7, 2022 · 6 comments

Comments

@agijbels
Copy link

agijbels commented Jan 7, 2022

Can be reproduced using

https://codepen.io/davidshimjs/pen/NdBYrg

In the JS, line nr 12, change to following:
qrcode.makeCode("íadsfasdsöadfas");

It doesn't draw anything.

@FlorianJa
Copy link

I observed some strange behaviour regarding this.

ö works
ö1 works
ö12 does not work
ö123 works
ö1234 works
ö12345 does not work
ö123456 does not work

it does not matter if the chars after ö are 1 2 3 or a b c . Same behaviour for äÄ öÖ and üÜ.

@jp-ed
Copy link

jp-ed commented Jun 17, 2022

This issue was fixed by pull request #273. Thanks to 19z.

Looks like this repo is no longer maintained, so you can find the fork here.

@RMerl
Copy link

RMerl commented Aug 3, 2022

The minified version of that fork returns an error here:

Uncaught SyntaxError: Unexpected identifier (at qrcode.min.js:1:16790)

However downloading the non-minified version and minifying it myself works. So, looks like the minified version of the fork is corrupted.

(and I can't find a way to contact the fork's author @19z either, so I'm leaving this warning here...)

19z added a commit to 19z/qrcodejs-fixUTF8 that referenced this issue Aug 4, 2022
se-ti added a commit to se-ti/qrcodejs that referenced this issue Oct 6, 2022
@onikaSharm1
Copy link

onikaSharm1 commented Sep 27, 2023

@davidshimjs
Please help me clarify some of my doubts regarding the qrcode.js library.

Is there any limitation of this library/cdn?
Can anyone provide me with the pros and cons of the qrcode js library?
I am using this cdn in my code: - "https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js
Please help me by providing answers to my question

I was trying to find answers to my doubts regarding the qrcode.js library in its documentation, but I couldn't find answers to my questions anywhere.

@divinity76
Copy link

divinity76 commented Jul 15, 2024

øll triggers the error.

@agijbels your title makes no sense as your test string is valid UTF-8, maybe you meant "non-ascii characters" or "non-latin characters" ?

An example of "invalid UTF-8" would be "\xC0\xAF" (In UTF-8 \xC0 must be followed by a byte in the range of \x80 to \xBF, hence \xC0\xAF is not valid UTF-8)

@agijbels
Copy link
Author

agijbels commented Jul 16, 2024 via email

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

No branches or pull requests

6 participants