public static function setCharacterSet($char_set)
    {
        $default   = self::getDefaultCharacterSet();
        $char_set  = $char_set ? strtoupper($char_set) : $default;
        $available = array_map("strtoupper", mb_list_encodings());
        $is_valid  = false;
        foreach($available as $a) {
            if ($a === $char_set) {
                $is_valid = true;
                break;
            } else if (str_replace("-", "", $a) === $char_set) {
                $char_set = $a;
                $is_valid = true;
                break;
            }
        }
        if (!$is_valid) {
            self::toss(
                "InvalidArgumentException",
                "Value '{0}' is not a valid character set name.",
                $char_set
            );
        }
        
        $mb_required = ["ASCII", "ISO-8859-1", $default];
        if (!self::$use_mbstring && !in_array($char_set, $mb_required)) {
            self::setUseMultiByte(true);
        }
        
        self::$char_set = $char_set;
    }