Codes generated by QtQR aren't decoded correctly by mobile apps

Bug #796387 reported by Ramiro Algozino
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
QR Tools
Fix Released
Critical
Ramiro Algozino

Bug Description

I've tried to decode some sample codes and I found that the mobile apps (QR Droid and Kaywa reader) doesn't decode correctly the generated codes. It seems to be a problem with the utf8-BOM character added by qrtools.py to the text. Please confirm!

On the other hand, if we don't add the BOM char, zbar doesn't decode correctly non-ascii characters like "ñ".

Tags: i18n utf8

Related branches

Revision history for this message
Ramiro Algozino (algozino) wrote :

Ok, I can confirm this now. If we don't add the BOM character to the beginning of the text being encoded everything works OK. Except that zbar has problems decoding it correctly and makes QtQR display the non-ascii characters wrong. See:

http://sourceforge.net/projects/zbar/forums/forum/1072195/topic/3956406

Revision history for this message
Ramiro Algozino (algozino) wrote :

What happens is that mobile apps detect the data type of codes with the BOM character as TEXT and not as links, contact information, sms, etc. So I can think of 3 solutions / workarounds right now:

Solution #1: We add the BOM to the text data type only. That way zbar and mobile apps will decode everything OK (except the sms or emails bodys that have non-ascii chars by zbar)

Solution #2: Drop the BOM char and wait untill zbar fixes the bug. I reported it here:
https://sourceforge.net/tracker/?func=detail&aid=3322124&group_id=189236&atid=928515

Solution #3: Keep the BOM character so zbar decodes correctly non-ascii characters and brake decoding in mobile apps. (actually the BOM char shouldn't brake anything.. is just another char :-/)

Any more thoughts on this?

Revision history for this message
David Green (david4dev) wrote :

I'm in favour of #1 (seems the least disruptive to me) + hope the bug gets fixed in zbar.

Revision history for this message
Ramiro Algozino (algozino) wrote :

I think #1 is better too. I'm doing it that way until we have news from ZBar.. :-/

Changed in qr-tools:
status: New → Incomplete
assignee: nobody → Ramiro Algozino (algozino)
status: Incomplete → Won't Fix
Changed in qr-tools:
status: Won't Fix → Triaged
David Green (david4dev)
Changed in qr-tools:
milestone: qtqr-1.2 → 1.2
Revision history for this message
Ramiro Algozino (algozino) wrote :

From: http://stackoverflow.com/questions/2489048/qr-code-encoding-and-decoding-using-zxing

"The QR code spec doesn't allow anything but ISO-8859-1. Decoders happen to guess UTF-8 correctly sometimes, but can't always get it right. – Sean Owen Oct 14 '11 at 5:47"

So... maybe that's our solution :)

Alen Nedic (nalen719)
affects: qr-tools → webpg-chrome
Changed in webpg-chrome:
milestone: 1.2 → none
Colin Watson (cjwatson)
affects: webpg-chrome → qr-tools
Revision history for this message
Usama Akkad (damascene) wrote :

This is also effect crypto currency addresses, as because of utf8-BOM, addresses aren't recognized by wallets.

https://bugs.launchpad.net/qr-tools/+bug/1896189

Revision history for this message
Ramiro Algozino (algozino) wrote :

This is still an issue, couldn't find a definitive solution. As a workaround I added a addBom property to the QR class that you can set to False to avoid adding the BOM character. QtQR also now allows you to disable the BOM.

Revision history for this message
Dirk (dirk84) wrote :

In which version of QtQR was the "disable BOM" option added?
I've apperantly installed an outdated QtQR as I cannot find such an option.
Version: 2.0~bzr33-2
Ubuntu 20.10 (groovy)

Revision history for this message
Dirk (dirk84) wrote :

Okay, after some research I found out that I have to switch to the daily builds:
https://code.launchpad.net/~qr-tools-developers/+recipe/python-qr-tools-daily
https://code.launchpad.net/~qr-tools-developers/+recipe/qtqr-daily

Thanks for imlementing this feature.

Revision history for this message
Ramiro Algozino (algozino) wrote :

Yes, switching to the daily should do the trick ;)

Anyway, for completeness, the fix landed on version 2.1.0~42

Changed in qr-tools:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.