qrcodejs icon indicating copy to clipboard operation
qrcodejs copied to clipboard

encounter error: code length overflow. (1740>1056)

Open sgcol opened this issue 5 years ago • 2 comments

when i try to encode the string like this

https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxec73fe538fbc098e&redirect_uri=http%3A%2F%2Fother.dsydsc.xyz%2Fdonothing&response_type=code&scope=snsapi_base&state=5e2ff45a2128b157aab7b8c1#wechat_redirect

further more, a string with bigger size than that one is ok, but this one will trigger the error

sgcol avatar Jan 28 '20 08:01 sgcol

I recently fixed a similar problem. I haven't repeat your bug. Check if the statement that references the JS file is "" or "qrcode.min.js". Maybe it is "src="http://static.runoob.com/assets/qrcode/qrcode.min.js" or something and that is wrong. Keep the "qrcode.js" is latest and try it again.

znsoooo avatar Mar 21 '20 08:03 znsoooo

I found the same error, which only appeared when passing a variable containing the string to text, but passing it directly didn't give an error, so I realized that my string, which is a URL, had spaces, so I used encodeURI() and it worked

MiqueiasDevGames avatar Jan 20 '24 23:01 MiqueiasDevGames