php-i18n Digest 2 Feb 2011 06:45:46 -0000 Issue 454
Topics (messages 1428 through 1430):
encoding decoding question from iphone to msql and back
1428 by: olivier destrebecq
1429 by: Tom Worster
1430 by: textexin.xencraft.com
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin 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
--- End Message ---
--- Begin Message ---
Unicode LATIN SMALL LETTER E WITH ACUTE in utf8 is 0xC3 0xA9.
Check the character table at:
http://en.wikipedia.org/wiki/ISO/IEC_8859-1
to see what 0xC3 0xA9 would decode to if you decoded it to latin1.
So I guess everything is working correctly except for one thing: when you
checked the string value in your database it was displayed as if it were
latin1 instead of utf8.
On 2/1/11 10:48 AM, "olivier destrebecq" <[email protected]> wrote:
>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
>
>--
>PHP Unicode & I18N Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Tom is right. See http://www.i18nqa.com for more details
Sent from my Verizon Wireless BlackBerry
-----Original Message-----
From: Tom Worster <[email protected]>
Date: Tue, 01 Feb 2011 11:08:28
To: <[email protected]>; <[email protected]>
Subject: Re: [PHP-I18N] encoding decoding question from iphone to msql and
back
Unicode LATIN SMALL LETTER E WITH ACUTE in utf8 is 0xC3 0xA9.
Check the character table at:
http://en.wikipedia.org/wiki/ISO/IEC_8859-1
to see what 0xC3 0xA9 would decode to if you decoded it to latin1.
So I guess everything is working correctly except for one thing: when you
checked the string value in your database it was displayed as if it were
latin1 instead of utf8.
On 2/1/11 10:48 AM, "olivier destrebecq" <[email protected]> wrote:
>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
>
>--
>PHP Unicode & I18N Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP Unicode & I18N Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---