src/org/nutz/http/Response.java
public String getEncodeType() {
        String contentType = header.get("Content-Type");
        if (null != contentType) {
            for (String tmp : contentType.split(";")) {
                if (tmp == null)
                    continue;
                tmp = tmp.trim();
                if (tmp.startsWith("charset=")) {
                    tmp = Strings.trim(tmp.substring(8)).trim();
                    if (tmp.contains(","))
                        tmp = tmp.substring(0, tmp.indexOf(',')).trim();
                    return tmp;
                }
            }
        }
        return Encoding.UTF8;
    }
public String getEncodeType() {
        String contentType = header.get("Content-Type");
        if (null != contentType) {
            for (String tmp : contentType.split(";")) {
                if (tmp == null)
                    continue;
                tmp = tmp.trim();
                if (tmp.startsWith("charset=")) {
                    tmp = Strings.trim(tmp.substring(8)).trim();
                    if (tmp.contains(","))
                        tmp = tmp.substring(0, tmp.indexOf(',')).trim();
                    return tmp;
                }
            }
        }
        return Encoding.UTF8;
    }
public String getEncodeType ( ) { String contentType = header . get ( "Content-Type" ) ; if ( null != contentType ) { for ( String tmp : contentType . split ( ";" ) ) { if ( tmp == null ) continue ; tmp = tmp . trim ( ) ; if ( tmp . startsWith ( "charset=" ) ) { tmp = Strings . trim ( tmp . substring ( 8 ) ) . trim ( ) ; if ( tmp . contains ( "," ) ) tmp = tmp . substring ( 0 , tmp . indexOf ( ' ' ) ) . trim ( ) ; return tmp ; } } } return Encoding . UTF8 ; }
根据Http头的Content-Type获取网页的编码类型，如果没有设的话则返回null
根据Http头的Content - Type获取网页的编码类型，如果没有设的话则返回null