URL Encoding of Characters in a password field
Posted
by Alavoil
on Stack Overflow
See other posts from Stack Overflow
or by Alavoil
Published on 2010-04-28T02:41:47Z
Indexed on
2010/04/28
3:13 UTC
Read the original article
Hit count: 325
I am trying to pass login credentials to a PHP script that I have in my iPhone app. When I pull a password with special characters the password is missing certain characters especially the percent sign. I am trying to encode the text but even before I send it, the percent sign is missing.
//password_field is a UITextField holding the password: !@#$%^&*()
NSString *tmpPass = [password_field.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSLog(p_field.text);
NSLog(tmpPass);
This is what appears in the console:
!@#$^&*()
[email protected]&*()
Is there any reason why it would be dropping the percent sign?
© Stack Overflow or respective owner