public static function getCharsetInt($cs)
{
/**
* From http://www.iana.org/assignments/character-sets
*/
$charsetInt = array('US-ASCII' => 3, 'ISO-8859-1' => 4, 'UTF-8' => 106, 'UTF-16BE' => 1013, 'UTF-16LE' => 1014, 'UTF-16' => 1015);
return isset($charsetInt[$cs]) ? $charsetInt[$cs] : null;
}