Percent encoded character in image uri

718 views
Skip to first unread message

Vladimir Shabunin

unread,
Mar 31, 2017, 7:46:40 PM3/31/17
to comman...@googlegroups.com
Hi.

When trying to assign uri with percent encoded character iViewer encodes % character as %25 except cases with %20 and %25 of course.

Here you can see debugger screenshot:
https://firebasestorage.googleapis.com/v0/b/jesper-12dc1.appspot.com/o/images%2FimagesInIviewer.png?alt=media&token=77f122c5-9250-4721-afeb-f78b6ed485f1

Tried with iViewer 4 and iViewer 5 has the same behavior.
decodeURIComponent doesn't work in my case, you may try to replace %2F in link to screenshot

Will appreciate any advice

Jarrod Bell

unread,
Apr 1, 2017, 7:14:31 PM4/1/17
to comman...@googlegroups.com
Sorry but I do not fully understand what you are trying to do and what the expected behaviour is that you are after.

Can you please explain in more detail?

Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com

On 1/4/17 10:46 am, Vladimir Shabunin wrote:
Hi.

When trying to assign uri with percent encoded character iViewer encodes % character as %25 except cases with %20 and %25 of course.

Here you can see debugger screenshot:


Tried with iViewer 4 and iViewer 5 has the same behavior.
decodeURIComponent doesn't work in my case, you may try to replace %2F in link to screenshot

Will appreciate any advice
--
You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commandfusio...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vladimir Shabunin

unread,
Apr 1, 2017, 7:25:53 PM4/1/17
to comman...@googlegroups.com
For example, create image object and assign url
https://firebasestorage.googleapis.com/v0/b/jesper-12dc1.appspot.com/o/images%2Ffirebase-logo.png?alt=media&token=adab88a6-0585-4c7d-8ecc-186f49859fc8

to it. It won't work  cause iViewer replaces % characer with %25. decodeURIComponent won't work too: you may try in browser:

https://firebasestorage.googleapis.com/v0/b/jesper-12dc1.appspot.com/o/images/firebase-logo.png?alt=media&token=adab88a6-0585-4c7d-8ecc-186f49859fc8

воскресенье, 2 апреля 2017 г., 2:14:31 UTC+3 пользователь Jarrod Bell написал:

Vladimir Shabunin

unread,
Apr 4, 2017, 1:22:05 PM4/4/17
to CommandFusion Software
Can you please take a look at this issue?

Barry Gordon

unread,
Apr 4, 2017, 2:48:24 PM4/4/17
to comman...@googlegroups.com
I am just as confused as the CF team. Could you describe what you are trying to do. I have hundreds of images in my CF project with no issue.

Are you trying to build an image in CF? Normally CF does not build an image but uses an image resource which is the path to the image that you provide.

If you can explain what you are doing, not the end result but the steps you are taking to get there, I am sure someone will help you.

Vladimir Shabunin

unread,
Apr 4, 2017, 3:19:56 PM4/4/17
to CommandFusion Software
Hi, Barry

https://www.dropbox.com/s/h6iwv49345v8ti4/image.gui?dl=0
if you take a look there is only one image object with url assigned. It doesn't load when you launch iViewer.

So, I took a look at debugger and got that iViewer replaces '%' symbol in image url to %25.
Take a look at screenshot https://www.dropbox.com/s/z94zijf7eiun4p2/252f.png?dl=0
originally, there just should be just %2F instead selected %252F

вторник, 4 апреля 2017 г., 21:48:24 UTC+3 пользователь Barry Gordon написал:

Barry Gordon

unread,
Apr 4, 2017, 3:44:16 PM4/4/17
to comman...@googlegroups.com

I do not think that iViewer is doing that. If it was there would be an awfully lot of images that would fail to load as the ASCII code for the % (37 base 10, 25 base 16) has a high probability of appearing in a binary file such as an image file.  

 

I looked at your gui and it seems you are trying to directly load an image from a web site into an image box in the startup page.  using https.  The CF wiki clearly states that the image may come from an http site, but makes no mention of https.

 

I am not sure you can do that.  I never do, I have all my images in a resource file that the gui loads.   I dynamically load images but always from a resource folder which is set up is to hold the images. 

 

I do not see a theme in your gui where one normally defines the image path to be used.  If you hand built the gui as a text file, that would explain a lot. I tried using the https path you have as the image reference and I get a 403 error which is the web server saying "NO! (forbidden)

Vladimir Shabunin

unread,
Apr 4, 2017, 4:01:00 PM4/4/17
to CommandFusion Software
I did not talk about image content, the issue is with path string.
I thought about https too but here is another example:

https://www.dropbox.com/s/2yiypsf0c3zu7i8/image2_db.gui?dl=0
There is same startup page with image but image path is https://dl.dropboxusercontent.com/s/z94zijf7eiun4p2/252f.png?dl=0 and it works fine over https.

As for 403 error you may get it if you copied xml-encoded url from text editor

The original path is this one:
https://firebasestorage.googleapis.com/v0/b/jesper-12dc1.appspot.com/o/images%2Ffirebase-logo.png?alt=media&token=adab88a6-0585-4c7d-8ecc-186f49859fc8

вторник, 4 апреля 2017 г., 22:44:16 UTC+3 пользователь Barry Gordon написал:

Jarrod Bell

unread,
Apr 4, 2017, 6:24:12 PM4/4/17
to comman...@googlegroups.com
Is there a reason you are entering html-encoded characters rather than just the actual ascii?
Seems to me if you just enter the correct characters it will work.


Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com

Vladimir Shabunin

unread,
Apr 4, 2017, 6:27:13 PM4/4/17
to CommandFusion Software
It won't

https://firebasestorage.googleapis.com/v0/b/jesper-12dc1.appspot.com/o/images/firebase-logo.png?alt=media&token=adab88a6-0585-4c7d-8ecc-186f49859fc8

returns JSON
{
 
"error": {
   
"code": 400,
   
"message": "Invalid HTTP method/URL pair."
 
}
}



среда, 5 апреля 2017 г., 1:24:12 UTC+3 пользователь Jarrod Bell написал:

Jarrod Bell

unread,
Apr 4, 2017, 7:02:26 PM4/4/17
to comman...@googlegroups.com
Ahh I see, so the URL itself has to be sent without first decoding the characters.
Seems this is an issue in the HTTP library we are using in iViewer 4 (which has been replaced in upcoming iViewer 5).

We will look into a possible fix, but it might not be possible without other repercussions.


Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com

Reply all
Reply to author
Forward
0 new messages