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:
Bringing Unicode to PHP with Portable UTF-8
September 10, 2013 @ 11:19:05

On the SitePoint PHP blog there's a new tutorial showing you how to bring portable UT-8 support to PHP with the Portable-UTF8 library. UTF-8 handling has long been one thing desired in the core of PHP, but hasn't been introduced quite yet.

PHP's lack of Unicode/multibyte support means that the standard string handling functions treat strings as a sequence of single-byte characters. In fact, the official manual defines a string in PHP as a "series of characters, where a character is the same as a byte." PHP supports only 8-bit characters, while Unicode (and many other character sets) may require more than one byte to represent a character. This limitation of PHP affects almost all aspects of string manipulation, including (but not limited to) substring extraction, determining string lengths, string splitting, shuffling etc.

The article mentions some of the efforts in the past that have been made to try to introduce this functionality into the core, but was shelved at the time. Instead of waiting on this feature to be introduced, they show you how to use the library to do things like check for UTF-8 strings, "cleaning" the UTF-8 strings and do some validation on the string's contents.

0 comments voice your opinion now!
unicode portable utf8 library tutorial

Link: http://www.sitepoint.com/bringing-unicode-to-php-with-portable-utf8/

blog comments powered by Disqus

Similar Posts

SitePoint PHP Blog: Functional Testing in Symfony2

NetTuts.com: Letís TDD a Simple App in PHP

Jani Hartikainen's Blog: Zend_Acl part 2: different roles and resources, more on access

CodeForest.net: How to crop an image using jQuery and PHP

Phil Sturgeon's Blog: How to: Multi-site CodeIgniter Set-up


Community Events

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


podcast series voicesoftheelephpant interview laravel5 laravel list language introduction library api framework community wordpress opinion php7 release unittest extension version

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