includes/normal/UtfNormalUtil.php File Reference

Go to the source code of this file.

Functions

 codepointToUtf8 ($codepoint)
 Some of these functions are adapted from places in MediaWiki.
 hexSequenceToUtf8 ($sequence)
 Take a series of space-separated hexadecimal numbers representing Unicode code points and return a UTF-8 string composed of those characters.
 utf8ToHexSequence ($str)
 Take a UTF-8 string and return a space-separated series of hex numbers representing Unicode code points.
 utf8ToCodepoint ($char)
 Determine the Unicode codepoint of a single-character UTF-8 sequence.
 escapeSingleString ($string)
 Escape a string for inclusion in a PHP single-quoted string literal.


Function Documentation

codepointToUtf8 ( codepoint  ) 

Some of these functions are adapted from places in MediaWiki.

Should probably merge them for consistency.

Access:
public Return UTF-8 sequence for a given Unicode code point. May die if fed out of range data.
Parameters:
$codepoint Integer:
Returns:
String
Access:
public

Definition at line 39 of file UtfNormalUtil.php.

Referenced by hexSequenceToUtf8(), EnhancedChangesList::spacerArrow(), EditPage::unmakesafe(), and CleanUpTest::XtestAllChars().

escapeSingleString ( string  ) 

Escape a string for inclusion in a PHP single-quoted string literal.

Parameters:
$string String: string to be escaped.
Returns:
String: escaped string.
Access:
public

Definition at line 135 of file UtfNormalUtil.php.

hexSequenceToUtf8 ( sequence  ) 

Take a series of space-separated hexadecimal numbers representing Unicode code points and return a UTF-8 string composed of those characters.

Used by UTF-8 data generation and testing routines.

Parameters:
$sequence String
Returns:
String
Access:
private

Definition at line 64 of file UtfNormalUtil.php.

References $n, and codepointToUtf8().

utf8ToCodepoint ( char  ) 

Determine the Unicode codepoint of a single-character UTF-8 sequence.

Does not check for invalid input data.

Parameters:
$char String
Returns:
Integer
Access:
public

Definition at line 95 of file UtfNormalUtil.php.

References $i.

Referenced by Language::firstChar().

utf8ToHexSequence ( str  ) 

Take a UTF-8 string and return a space-separated series of hex numbers representing Unicode code points.

For debugging.

Parameters:
$str String: UTF-8 string.
Returns:
string
Access:
private

Definition at line 81 of file UtfNormalUtil.php.


Generated on Sat Sep 5 02:08:24 2009 for MediaWiki by  doxygen 1.5.9