Horde_Xml_Wbxml::getCharsetString PHP Method

getCharsetString() public static method

only default character encodings from J2SE are supported from http://www.iana.org/assignments/character-sets and http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html
public static getCharsetString ( $cs )
    public static function getCharsetString($cs)
    {
        /**
         * From http://www.iana.org/assignments/character-sets
         */
        $charsetString = array(3 => 'US-ASCII', 4 => 'ISO-8859-1', 106 => 'UTF-8', 1013 => 'UTF-16BE', 1014 => 'UTF-16LE', 1015 => 'UTF-16');
        return isset($charsetString[$cs]) ? $charsetString[$cs] : null;
    }

Usage Example

コード例 #1
0
ファイル: Decoder.php プロジェクト: raz0rsdge/horde
 /**
  * Returns the character encoding. Only default character
  * encodings from J2SE are supported.  From
  * http://www.iana.org/assignments/character-sets and
  * http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html
  */
 public function getCharset($input)
 {
     $cs = Horde_Xml_Wbxml::MBUInt32ToInt($input, $this->_strpos);
     return Horde_Xml_Wbxml::getCharsetString($cs);
 }