-
Notifications
You must be signed in to change notification settings - Fork 54
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
CLI: Add support to change the encoding (i.e. UTF-8) #84
Comments
Ah, I got it! I'm thinking of a solution, thanks for the hint! |
Hi, thanks for the immediate response 👍 Maybe it is worth to mention, that the encoding issue also exist when you use the helpers functions for any qr-code with free text: I met the problem, when I tried to create a vcard qr-code with helpers.make_vcard() containing an Umlaut: I was not allowed to explicitly specify the encoding, yet. Probably the best way would be, that the app detects itself, whether or not to fall back into UTF-8 encoding. But I have no clue, what this means for coding .. Kind regards, |
Well, I think the behaviour (try ISO 8859-1 and if it does not fit, use UTF-8) is correct acc. to ISO/IEC 18004. It seems to be an issue with the decoder app. Which decoder app do you use, btw? The >>> import segno
>>> from segno import helpers
>>> qr = helpers.make_vcard(name='Müller;Änne', displayname='Änne Müller', email='aenne@example.org', phone='+1234567')
>>> qr.save('vcard-iso.png', scale=5)
>>> # Use the _data factory
>>> data = helpers.make_vcard_data(name='Müller;Änne', displayname='Änne Müller', email='aenne@example.org', phone='+1234567')
>>> # Create and save a QR code with an explicit encoding == UTF-8
>>> segno.make(data, encoding='utf-8').save('vcard-utf8.png', scale=5) Results |
Ah, now I got it, sorry: In my first post, was confused why the zbarimg (linux, command line tool) returned the correct string, while the qr-decoder in the smartphone photo-app failed: zbarimg used latin-1 and the Samsung photo-App seems not to be able to handle latin-1.
Perfect! Helped a lot, thank you very much! |
No problem, thank you for discovering a bug! 👍 Your example
should work as expected with release 1.3.0 |
Hi,
Creating a qr-code with "German Umlauts":
$ segno -o=fool.png --encoding="UTF-8" --title="Example QR code" "The Fool on [123-äöüÖÄÜ-456] the Hill"
creates the fool.png file. Showing that png on my desktop and taking a picture smartphone (Galaxy Note 10), the smartphone finds the qr-code immediately, but it the German umlauts have been wrongly translated to some special characters (see Photo).
I use my Smartphone often to read qr-codes with Umlauts. I did not observe utf-8 decoding issues yet. Do you have any idea
Interestingly, fool.png can be decoded by zbarimg correctly as:
$ zbarimg fool.png QR-Code:The Fool on [123-äöüÖÄÜ-456] the Hill
Do you have any idea, why the qr-codes with German Umlauts are wrongly decoded by my smartphone, but correctly with zbarimg? Di you see any possibility for a workarounf or finxing?
Thank you & kind regards,
The text was updated successfully, but these errors were encountered: