News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Pablo Viquez' Blog:
How to use json_encode with ISO-8859-1 data '" Part2
August 03, 2009 @ 07:57:10

As he mentioned in a previous entry on his blog, Pablo Viquez found a few issues with character encoding and the json_encode function. He revisits this in a second look at getting it to cooperate with ISO-8859-1 data.

One solution that I did, in order to preserve the character set was to encode the data before using the json_encode function to use just A-Z, a-z and 0-9 characters, instead of sending text with accents or symbols. One encoding that fits perfectly in this schema, is Base64 Content-Transfer-Encoding. (see base 64 explanation below) This leads me to the solution: Encode the ISO-8859-1 using base64 and decoded in the client using JavaScript.

He includes both a code example for his solution and downloadable code for you to try it out yourself.

0 comments voice your opinion now!
jsonencode iso88591 javascript tutorial


blog comments powered by Disqus

Similar Posts

Matthew Weir O'Phinney's Blog: Cgiapp2 Tutorial 2 - Pluggable Applications

DeveloperTutorials.com: Writing A Simple Twitter Client Using the PHP Zend Framework's OAuth Library

Matthew Weier O'Phinney's Blog: Taming SplPriorityQueue

Oracle Technology Network: Creating an Ajax Process Using PHP and Oracle

Joomla Community Site: Creating a Joomla Template From Scratch


Community Events





Don't see your event here?
Let us know!


threedevsandamaybe list api tips framework series conference deployment zendserver community code laravel developer language introduction symfony interview podcast development release

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework