my apostrophe turns into ’

Posted by Bryce Naron on Stack Overflow See other posts from Stack Overflow or by Bryce Naron
Published on 2012-06-07T21:55:17Z Indexed on 2012/06/07 22:41 UTC
Read the original article Hit count: 774

Filed under:
|
|
|

i'm trying to send the iOS device name along with the deviceToken to my server in didRegisterForRemoteNotificationsWithDeviceToken.. my device has an apostrophe in it and the request string shows as ....&name=John+Doe’s+iPhone ... I've tried replacing "'" with "" and "’" with "" .. but neither fix it.. i assume i need to convert the encoding?

NSString *string = [[UIDevice currentDevice] name];
output-> John Doe’s iPhone

EDIT

output is from NSLog(string);

© Stack Overflow or respective owner

Related posts about ios

Related posts about xcode