Class: I2CE UTF8: Difference between revisions

From IHRIS Wiki
No edit summary
No edit summary
Line 5: Line 5:
===cp_to_code()===
===cp_to_code()===
*Signature: static public function cp_to_code($code_point)
*Signature: static public function cp_to_code($code_point)
Parameters:
*Parameters:
*$code_point  
*$code_point  
===encodeStringFromCodepoints()===
===encodeStringFromCodepoints()===
Given unicode codepoints, create the corresponding string
Given unicode codepoints, create the corresponding string @param array code_points an array of code points
@param array code_points an array of code points
*Signature: static public function encodeStringFromCodepoints($code_points,$as_array)
*Signature: static public function encodeStringFromCodepoints($code_points,$as_array)
Parameters:
*Parameters:
*$code_points  
*$code_points  
* [http://www.php.net/manual/en/language.types.boolean.php boolean ] $as_array<br/>true if we want output as an array, false if we output as a string
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $as_array <br/>true if we want output as an array, false if we output as a string
**Default Value: false  
***Default Value: false  
===to_codepoints()===
===to_codepoints()===
Given a string encoded in utf8, it returns an array of the unicode codepoints
Given a string encoded in utf8, it returns an array of the unicode codepoints (adapted from tcpdf.php)
(adapted from tcpdf.php)
*Signature: static public function to_codepoints($str)
*Signature: static public function to_codepoints($str)
*Returns: [http://www.php.net/manual/en/language.types.array.php array ] of int  the unicode code points
*Parameters:
Parameters:
*$str  
*$str  
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of int  the unicode code points




[[Category:Class Documentation]]
[[Category:Class Documentation]]

Revision as of 22:43, 16 October 2009

This article desrcibes the class I2CE_UTF8.

Methods

cp_to_code()

  • Signature: static public function cp_to_code($code_point)
  • Parameters:
  • $code_point

encodeStringFromCodepoints()

Given unicode codepoints, create the corresponding string @param array code_points an array of code points

  • Signature: static public function encodeStringFromCodepoints($code_points,$as_array)
  • Parameters:
  • $code_points
    • boolean $as_array
      true if we want output as an array, false if we output as a string
      • Default Value: false

to_codepoints()

Given a string encoded in utf8, it returns an array of the unicode codepoints (adapted from tcpdf.php)

  • Signature: static public function to_codepoints($str)
  • Parameters:
  • $str
  • Returns: array
    of int the unicode code points