Unicode.php

Provides some PHP classes for maniuplating Unicode data.
Download

Unicode.php Ranking & Summary

Advertisement

  • Rating:
  • License:
  • LGPL
  • Price:
  • FREE
  • Publisher Name:
  • CentralNic Labs
  • Publisher web site:
  • http://labs.centralnic.com/preppi.php

Unicode.php Tags


Unicode.php Description

Provides some PHP classes for maniuplating Unicode data. Unicode.php provides some PHP classes for maniuplating Unicode data. These classes are general purpose but are intended for use when working with Internationalised Domain Names (IDNs).Existing support for Unicode and multi-byte strings in PHP is not great, requiring either an extension that is not compiled into PHP by default, or one of a number of third-party libraries, most of which are not currently maintained (for example, the I18N_UnicodeString class in PEAR was last updated in August 2004).There is a Unicode extension under development, but it isn't public yet, and again requires a third party library to do the heavy lifting, so probably won't be enabled in a default PHP build.Using the CentralNic Unicode Library is as simple as downloading the current release, and including the main Unicode.php file from your scripts. You then get instant access to the two Unicode_String and Unicode_Character classes.Example Usage: < ?phprequire('Unicode.php');$string =& new Unicode_String();$string->fromUTF8("?ē???, ?????!");print "String contains ".$string->length()." characters.n";print "String contains characters from the following blocks:".implode(', ', $string->blocks())."n";print "String in UTF-8: ".$string->toUTF8()."n";print "String in UPPERCASE: ".$string->toUpper()->toUTF8()."n";$comma =& new Unicode_Character(ord(','));$words = explode($comma);foreach ($words as $word) { print "Word has ".$word->length()." characters.n";}? > What's New in This Release: · This release fixes a bug in the toLower() method of Unicode_Character which would return a NULL value if no lower-case character could be found.


Unicode.php Related Software