public static Charset toCharset(final String charset) {
        return charset == null ? Charset.defaultCharset() : Charset.forName(charset);
    }
Returns a Charset for the named charset. If the name is null, return the default Charset.

@param charset
           The name of the requested charset, may be null.
@return a Charset for the named charset
@throws java.nio.charset.UnsupportedCharsetException
            If the named charset is unavailable
replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/utils/Charsets.java