*
* @param string $string a UTF-8 string
* @return string a clean, shiny, normalized UTF-8 string
+ * @static
*/
- function cleanUp( $string ) {
+ static function cleanUp( $string ) {
if( NORMALIZE_ICU ) {
# We exclude a few chars that ICU would not.
$string = preg_replace(
*
* @param string $string a valid UTF-8 string. Input is not validated.
* @return string a UTF-8 string in normal form C
+ * @static
*/
- function toNFC( $string ) {
+ static function toNFC( $string ) {
if( NORMALIZE_ICU )
return utf8_normalize( $string, UNORM_NFC );
elseif( UtfNormal::quickIsNFC( $string ) )
*
* @param string $string a valid UTF-8 string. Input is not validated.
* @return string a UTF-8 string in normal form D
+ * @static
*/
- function toNFD( $string ) {
+ static function toNFD( $string ) {
if( NORMALIZE_ICU )
return utf8_normalize( $string, UNORM_NFD );
elseif( preg_match( '/[\x80-\xff]/', $string ) )
*
* @param string $string a valid UTF-8 string. Input is not validated.
* @return string a UTF-8 string in normal form KC
+ * @static
*/
- function toNFKC( $string ) {
+ static function toNFKC( $string ) {
if( NORMALIZE_ICU )
return utf8_normalize( $string, UNORM_NFKC );
elseif( preg_match( '/[\x80-\xff]/', $string ) )
*
* @param string $string a valid UTF-8 string. Input is not validated.
* @return string a UTF-8 string in normal form KD
+ * @static
*/
- function toNFKD( $string ) {
+ static function toNFKD( $string ) {
if( NORMALIZE_ICU )
return utf8_normalize( $string, UNORM_NFKD );
elseif( preg_match( '/[\x80-\xff]/', $string ) )
/**
* Load the basic composition data if necessary
* @private
+ * @static
*/
- function loadData() {
+ static function loadData() {
# fixme : are $utfCanonicalComp, $utfCanonicalDecomp really used?
global $utfCombiningClass, $utfCanonicalComp, $utfCanonicalDecomp;
if( !isset( $utfCombiningClass ) ) {
* Returns false if not or uncertain.
* @param string $string a valid UTF-8 string. Input is not validated.
* @return bool
+ * @static
*/
- function quickIsNFC( $string ) {
+ static function quickIsNFC( $string ) {
# ASCII is always valid NFC!
# If it's pure ASCII, let it through.
if( !preg_match( '/[\x80-\xff]/', $string ) ) return true;
* Returns true if the string is _definitely_ in NFC.
* Returns false if not or uncertain.
* @param string $string a UTF-8 string, altered on output to be valid UTF-8 safe for XML.
+ * @static
*/
- function quickIsNFCVerify( &$string ) {
+ static function quickIsNFCVerify( &$string ) {
# Screen out some characters that eg won't be allowed in XML
$string = preg_replace( '/[\x00-\x08\x0b\x0c\x0e-\x1f]/', UTF8_REPLACEMENT, $string );
* @param string $string
* @return string
* @private
+ * @static
*/
- function NFC( $string ) {
+ static function NFC( $string ) {
return UtfNormal::fastCompose( UtfNormal::NFD( $string ) );
}
* @param string $string
* @return string
* @private
+ * @static
*/
- function NFD( $string ) {
+ static function NFD( $string ) {
UtfNormal::loadData();
global $utfCanonicalDecomp;
return UtfNormal::fastCombiningSort(
* @param string $string
* @return string
* @private
+ * @static
*/
- function NFKC( $string ) {
+ static function NFKC( $string ) {
return UtfNormal::fastCompose( UtfNormal::NFKD( $string ) );
}
* @param string $string
* @return string
* @private
+ * @static
*/
- function NFKD( $string ) {
+ static function NFKD( $string ) {
global $utfCompatibilityDecomp;
if( !isset( $utfCompatibilityDecomp ) ) {
require_once( 'UtfNormalDataK.inc' );
* @param string $string Valid UTF-8 string
* @param array $map hash of expanded decomposition map
* @return string a UTF-8 string decomposed, not yet normalized (needs sorting)
+ * @static
*/
- function fastDecompose( $string, &$map ) {
+ static function fastDecompose( $string, &$map ) {
UtfNormal::loadData();
$len = strlen( $string );
$out = '';
* @private
* @param string $string a valid, decomposed UTF-8 string. Input is not validated.
* @return string a UTF-8 string with combining characters sorted in canonical order
+ * @static
*/
- function fastCombiningSort( $string ) {
+ static function fastCombiningSort( $string ) {
UtfNormal::loadData();
global $utfCombiningClass;
$len = strlen( $string );
* @private
* @param string $string a valid UTF-8 string in sorted normal form D or KD. Input is not validated.
* @return string a UTF-8 string with canonical precomposed characters used where possible
+ * @static
*/
- function fastCompose( $string ) {
+ static function fastCompose( $string ) {
UtfNormal::loadData();
global $utfCanonicalComp, $utfCombiningClass;
$len = strlen( $string );
* interate through a string without really doing anything of substance.
* @param string $string
* @return string
+ * @static
*/
- function placebo( $string ) {
+ static function placebo( $string ) {
$len = strlen( $string );
$out = '';
for( $i = 0; $i < $len; $i++ ) {
}
}
-?>
+?>
\ No newline at end of file