解决httpclient传中文乱码问题

这问题是源码本身的问题,在httpcore-4.2.1.jar文件中有个Consts.java类文件内容如下:

package org.apache.http;

import java.nio.charset.Charset;

/**
 * Commons constants.
 *
 * @since 4.2
 */
public final class Consts {

    public static final int CR = 13; // <US-ASCII CR, carriage return (13)>
    public static final int LF = 10; // <US-ASCII LF, linefeed (10)>
    public static final int SP = 32; // <US-ASCII SP, space (32)>
    public static final int HT = 9;  // <US-ASCII HT, horizontal-tab (9)>

    public static final Charset UTF_8 = Charset.forName("UTF-8");
    public static final Charset ASCII = Charset.forName("US-ASCII");
    public static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1");

    private Consts() {
    }

}


你可能感兴趣的:(解决httpclient传中文乱码问题)