News Feed
Sections




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

SitePoint PHP Blog:
Character Encoding Issues with Cultural Integration
September 10, 2008 @ 12:07:06

On the SitePoint PHP Blog Troels Knak-Nielsen points out some "cultural integration issues" he's seen when it comes to character encoding in his PHP applications.

The gold standard solution is to convert everything to utf-8. Since utf-8 covers the entire unicode range, it is capable of representing any character that latin1 can. Unfortunately, that's a lot easier to do from the outset, than with a big, running application. And even then, there may be third party code and extensions, which assume latin1. I'd much rather continue with latin1 being the default, and only jump through hoops at the few places where I actually need full utf-8 capacity.

He came up with a (relatively) simple solution - keep the information encoded in the latin1 he already has but serve up the pages with a utf-8 format, embedding utf-8 inside the latin1 when needed. He gives the code for both, making use of output buffering and the utf8 encoding functions to make it all work.

0 comments voice your opinion now!
character encoding cultural integration utf8 latin1 tutorial


blog comments powered by Disqus

Similar Posts

SitePoint PHP Blog: Introduction to Gearman - Multitasking in PHP

MaltBlue.com: Zend Form Mastery with Zend Config - Part 4 Configuring Zend Validators

HowToForge.com: Installing Lighttpd With PHP5 And MySQL Support On OpenSUSE 11.1

HowTo Forge: How To Harden PHP5 With Suhosin On Fedora 7

DevShed: Implementing Destructors with Multiple Objects in PHP 5


Community Events





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


package interview opinion list series tips introduction zendserver framework language api laravel community library release podcast update symfony install deployment

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