URLs with query strings

260 views
Skip to first unread message

xmediaman

unread,
Feb 9, 2012, 12:10:05 PM2/9/12
to zxing
I just attempted to scan a url QR code with Barcode Scanner v4.0 where
the url contained a query string. When the url was decoded and
displayed, the query string was not underlined and therefore not
included in the request when I clicked it to open it in the browser.

Barcode Scanner v4.0
Android version 2.3.3
Kernel version 2.6.35.7-perf / ncmc@ncmc #1
Casio model C771 hardware version 1.1

Sean Owen

unread,
Feb 9, 2012, 12:14:24 PM2/9/12
to zx...@googlegroups.com
I can't reproduce this. Are you sure there's not a space in your URL? share the code if possible.

xmediaman

unread,
Feb 10, 2012, 3:25:05 PM2/10/12
to zxing
I've set up a page which will echo the query string and has a QR code
with query string at http://test.haqr.us?test=qr . This is not the
same QR code as the one that I reported about earlier. That QR code
lead to a redirect which made it hard to determine if the query string
was omitted. I have also created a QR code with a longer uri which
worked properly. Could it have something to do with the length of the
uri that's encoded in the QR code.

Sean Owen

unread,
Feb 10, 2012, 3:30:08 PM2/10/12
to zx...@googlegroups.com
Hmm, you're right, Android doesn't linkify that string properly and I don't know why. It is obviously a URL with query string. If you choose "Open Browser" it's fine; the URL is read properly. It is really an issue with Android's linkifying routine and I can't fix that one.

xmediaman

unread,
Feb 10, 2012, 5:31:41 PM2/10/12
to zxing
I didn't even notice the "Open Browser" button. I'll try to remember
that next time.

Ron DuPlain

unread,
Feb 11, 2012, 4:59:19 PM2/11/12
to xmediaman, zxing
On Fri, Feb 10, 2012 at 3:25 PM, xmediaman <kimwal...@gmail.com> wrote:
> On Feb 9, 12:14 pm, Sean Owen <sro...@gmail.com> wrote:
>> I can't reproduce this. Are you sure there's not a space in your URL? share
>> the code if possible.
> I've set up a page which will echo the query string and has a QR code
> with query string at http://test.haqr.us?test=qr . This is not the
> same QR code as the one that I reported about earlier. That QR code
> lead to a redirect which made it hard to determine if the query string
> was omitted. I have also created a QR code with a longer uri which
> worked properly. Could it have something to do with the length of the
> uri that's encoded in the QR code.

This is not a bug.

http://test.haqr.us?test=qr is not a valid URL, but
http://test.haqr.us/?test=qr is.

The slash separator is neither part of the host nor the query string,
but is required (RFC1738).

-Ron

Reply all
Reply to author
Forward
0 new messages