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

Doesn't recognize Cyrillic #76

Open
vladislavkovalskyi opened this issue Aug 10, 2020 · 1 comment
Open

Doesn't recognize Cyrillic #76

vladislavkovalskyi opened this issue Aug 10, 2020 · 1 comment

Comments

@vladislavkovalskyi
Copy link

How can I make the module recognize the Cyrillic alphabet?

My code:
image = pyqrcode.create('АБВГД', encoding='UTF-8') image.png(fileName, scale=4)
When scanning, it gives out question marks "?????"

@heuer
Copy link
Contributor

heuer commented Aug 10, 2020

The cyrillic characters are detected as Kanji:

>>> qr = pyqrcode.create('АБВГД')
>>> qr.mode
'kanji'

That seems to be correct but it is a bug that the provided encoding is ignored.

>>> qr = pyqrcode.create('АБВГД', encoding='utf-8')
>>> qr.mode
'kanji'

This lib is not actively maintained, give (shameless plug) Segno a try:

>>> import segno
>>> qr = segno.make_qr('АБВГД')
>>> qr.mode
'kanji'

If you provide an encoding, the result should be correct:

>>> import segno
>>> qr = segno.make_qr('АБВГД', encoding='utf-8')
>>> qr.mode
'byte'

Or you provide the content as bytes

>>> import segno
>>> qr = segno.make_qr('АБВГД'.encode('utf-8'))
>>> qr.mode
'byte'

Result:

pyqrcode-issue-76

heuer added a commit to heuer/segno that referenced this issue Aug 16, 2020
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

2 participants