I have a database, where I have a table which contains URL’s.
I have a .php script that shows me the URL. If I run the script in the browser, then copy and paste the result string in the browser, the image loads sucessfully.
But, I’m trying to get this URL trough Unity, with the script:
go = WWW(url);
yield go;
var imageurl = go.text;
The problem is:
When I try to acces the URL later, with the given text, Unity doesn’t recognize the URL as http. If I do a print(imageurl), then copy and paste this URL from Unity to inside the browser, I am redirected to Google.
The string in Unity has 39 characters, but the original from the page has 38.
Unity is adding an extra character before the “http” in the string.
I tried replacing this character, but I need to replace with a null character which will be ignored before the “http”, I tried imageurl.Remove(0,0), but stills not working.
Ok, solved, I tried imageurl.Remove(0,1), but this is such a cheap trick, why Unity adds and extra character to the WWW.text?
– ramonfr