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);
You should never use
NSLogwith a user-provided string like that.NSLogexpects a format string for its first argument. If it’s something containing a format specifier, it will probably crash your application, and may expose a security hole if provided by an untrusted source.Your encoding issue appears to be a bug in LLDB. Switching to GDB fixes the problem.