⚠️ Forum Maintenance: Feb 6th, 8am - 14pm (UTC+2)

Qt.openUrlExternally() sometimes works on Symbian^3 and sometimes not, why is this?

  • I am having some difficulty with @Qt.openUrlExternally@ on Symbian^3. Sometimes it works, sometimes not, and I can't find any pattern to it.

    Another user seems to be having the same problem here.

    When it does not work, the actual behaviour is that a web browser opens, comes to the foreground briefly (for a few seconds), then goes to the background. It is still open, but the URL does not load.

    @Qt.openUrlExternally("http://www.nokia.com")@ works.

    @Qt.openUrlExternally("http://twitter.com/share?text=ZOMG")@ fails. I initially concluded that this meant any URL with ? does not work, however this is wrong because...

    @Qt.openUrlExternally("http://twitter.com/intent/tweet?text=ZOMG")@ works. However, it seems to work for one word only because:

    @Qt.openUrlExternally("http://twitter.com/intent/tweet?text=Will this work")@ fails.

    Has anyone encountered a similar issue (specifically for sending arbitrary text to Twitter I suppose), and what have they done about it?

  • replace the spaces by + signs, that's the usual way to encode URL queries.

  • Hmm.

    I had already passed my URL through Javascript's encodeURI() function, so the actual string was http://twitter.com/intent/tweet?text=Will(percent20)this(percent20)work -- the forum code block option changed it to a space for me.

    However, replacing the (percent20)'s with +'s in the final URL does in fact work. Surely is the standard replacement for spaces? What if the URI parameter includes a plus sign?


    So, the following works OK: http://twitter.com/intent/tweet?text=Will+this+(percent2B)+work.

    I conclude from this that any URI parameters should be passed through Javascript's encodeURIComponent() function, with any (percent20)'s on the resulting string replaced with +'s.

    By this reasoning I see also that I was wrong in my second assertion above, "http://twitter.com/share?text=ZOMG" does work OK.

    Seems like a bug to me that (percent20) does not work, however this is what the Javascript encode functions use for space.

    Thanks for the help.

    EDITED to replace (percent20) which this damn forum software always actually substitutes for a space.

  • As a workaround wrap text you do not want to be substituted within @ tags.

  • Hi.

    I did that the first time, it substituted percent20 for space.

    @typing percent20 HERE --> <--@

Log in to reply