Hi.
I tried to encode a string into URL friendly format but it seems it’s not working correctly.
var username:String = "Test 123"
var encodedUsername:String = WWW.EscapeURL(username);
Debug.Log("Encoded username is: "+encodedUsername); //The result is "Test+123" instead of supposedly "Test%20123"
while the other set of code I have:
var email:String = "email@email.com"
var encodedEmail:String = WWW.EscapeURL(email);
Debug.Log("Encoded email is: "+encodedEmail); //The result is "email%40email.com
Is there anything I missed? Thanks in advance.
I thought of manually using Replace(" ","%20")
but then this won’t work with other characters and I can’t predict what characters will be used by the user.