Page 1 of 1

Why does TC URLencode local file paths?

Posted: 2019-11-05, 00:04 UTC
by Tippfehler
If I select Share or "Open with" for one or more files and send them to Image Shrink (a batch resizer app), the resulting file names are urlencoded - meaning, every space is replaced by %20, & by %26 and so on.

Example:

Code: Select all

AES vs EMR - Active (pressure-sensitive) Display Technologies (2018) - slrloungecom.jpg
Result:

Code: Select all

AES%20vs%20EMR%20-%20Active%20(pressure-sensitive)%20Display%20Technologies%20(2018)%20-%20slrloungecom.jpg
URL encoding/URIencoding is generally done on the webs to deal with "untrusted" links (and mask spaces and special characters).

But why with local files on Android? :?

Maybe, to protect badly written apps that can't properly deal with extended charsets (Unicode) from crashing (or worse)? -- as some kind of general security measure? After all, TC is running as root (a lot).

Or for the benefit of a plugin? Please explain.

Re: Why does TC URLencode local file paths?

Posted: 2019-11-05, 11:26 UTC
by ghisler(Author)
Yes, this is necessary - the paths passed to other apps are urls in the form file:// or content:// and must not contain spaces. It's the duty of the receiving app to urldecode these names.

Re: Why does TC URLencode local file paths?

Posted: 2019-11-06, 21:41 UTC
by Tippfehler
I've emailed the developer of Image Shrink and asked them to add URIdecoding capability, let's see what (if anything) s/he replies.

Thanks for explaining. However, gallery apps don't appear to do this, generally, while file managers do - X-plore too. Apples & oranges?

Image Shrink has a unique defense mechanism - whatever you throw at it, it can throw right back! So, with an image shared from X-plore or Total Commander (Send to), and shared back for saving, guess what... the results are URIencoded! :mrgreen: The complex sharing mechanisms involved also seem to get a bit confused, because I end up with two or three (resized) copies of the shared image(s).

There are gazillions of photo resizing apps, but somehow Image Shrink (Google Play) is the only one I've come across so far that can deal with fairly LARGE images, reliably. I have a 1600x2500 screen, *only* 2,7 GB RAM, and a web browser that can take full-page screenshots. Somehow, this is a recipe for disaster for most apps... or at least for badly resized (or cropped), "pixellated" pictures.