I am trying to save images to the disk in an AIR app for smartphones.
I need a method, that can convert safely Web URLs to valid filenames on Android & iOS (if it would retain Windows/Mac compatibility it'd be good.), and i can get back the original full URL from the filename. For example:
Input is:
http://www.google.hu/search?client
Encoded format is something like (this is just some example i found out now):
http%d%s%swww.google.com%tsearch%rclient%z
And i'd need a method to convert it back.
I've looked into BASE64 - but this allows the "/" character, and im afraid to use HEX encoding, because this will generate super long filenames, and URLs can be lengthy.
According to another question, in iOS the max length pathname is 1024 bytes: max length of file name
Anyone has a solution for AIR? Basically this is the same question as Convert between URL and windows filename (Java)? - just for AIR, iOS, Android.
Or should i simply modify a BASE64 encoder, and do some hacks for long filenames?