encoding decoding question from iphone to msql and back
| From: | olivier destrebecq | Date: | Tue, 01 Feb 2011 15:48:38 +0000 |
| Subject: | encoding decoding question from iphone to msql and back | ||
| Groups: | php.i18n | ||
| Request: | Send a blank email to php-i18n+get-1428@lists.php.net to get a copy of this message | ||
I'm creating an iphone app that send data to a web server, then stores
it into mysql, then spit it out in an xml file and sends it back to
the iphone. i'm hitting some text conversion issue.
the string from the iphone is encoded following:
// Escape even the "reserved" characters for URLs
// as defined in http://www.ietf.org/rfc/rfc2396.txt
CFStringRef encodedValue =
CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
value,
NULL,
(CFStringRef)@";/?:@&=+$,",
kCFStringEncodingUTF8);
I as using urldecode on the receiving end to decode the character
before inserting them in the database, but it does not seem to work
M&Mé's is turned into M&Mé's in the database.
What should i be using to decode the URL when receiving it?
thank you
Olivier