Apparently, URL's cannot pass certain symbols, and the URL is ENCODED replacing these symbols
with a Percent sign (%) and as number.
Text String (URL) received:
Is there a plugin or built in Construct function to DECODE these URL strings?
If not, does anyone know of a way to take an existing string, such as in the above example, and
replace all of the ENCODED characters with the correct symbols?
I am looking for a "Search and Replace" routine, function, or method?
Develop games in your browser. Powerful, performant & highly capable.
ANSWER: Use the System Expression "RegexReplace" to SEARCH through a string and REPLACE any
characters, or string of characters with another character or string of characters.
Example: RegexReplace(Text.Text, "p", "g", "*")
Searches the string saved in "Text.Text" for the letter "p" and replaces it with "*"
The "g" is s GLOBAL FLAG property that just means to repeat the search and replace thru the
entire string, not just ONCE or the FIRST occurrence.
For my problem with URL special characters, I had to run several operations on the same string.
The % is followed by the ASCII code for the character that was replaced by the browser.
%3A = ":", etc.
You can use URLencode and URLdecode expressions.
URLDecode("data%3Aimage%2Fjpg") = "data:image/jpg"
Thank you DOP !!
Hey DOP, I am also having trouble with the "Local Storage" in Construct..
I can SET and GET variables ok "within" Construct, however, when I try to GET or SET
I need to save Base64 image data for use by other web pages, not Construct related.
The Base64 data can be large, so Cookies don't work, and passing these values within a
URL doesn't work either. Both cases, the file size exceeds the limits.
I found that I can save these large Bas64 image data strings to Local Storage, thinking I