Android截击API UTF-8

Android截击API UTF-8,android,utf-8,android-volley,Android,Utf 8,Android Volley,如何使用Android Volley API在页面源代码中获取阿拉伯语文本 谢谢 在com.android.volley.toolbox.HttpHeaderParser中更改返回的默认字符集以及在那里使用parseCharset方法是否可以帮助您 差不多 /** * Returns the charset specified in the Content-Type of this header, or the * UTF-8 if none can be found.

如何使用Android Volley API在页面源代码中获取阿拉伯语文本


谢谢

com.android.volley.toolbox.HttpHeaderParser
中更改返回的默认字符集以及在那里使用
parseCharset
方法是否可以帮助您

差不多

   /**
     * Returns the charset specified in the Content-Type of this header, or the
     * UTF-8 if none can be found.
     */
    public static String parseCharset(Map<String, String> headers) {
        String contentType = headers.get(HTTP.CONTENT_TYPE);
        if (contentType != null) {
            String[] params = contentType.split(";");
            for (int i = 1; i < params.length; i++) {
                String[] pair = params[i].trim().split("=");
                if (pair.length == 2) {
                    if (pair[0].equals("charset")) {
                        return pair[1];
                    }
                }
            }
        }
        return HTTP.UTF_8;
    }
/**
*返回此标头的内容类型中指定的字符集,或
*如果找不到,则为UTF-8。
*/
公共静态字符串parseCharset(映射头){
String contentType=headers.get(HTTP.CONTENT\u-TYPE);
if(contentType!=null){
String[]params=contentType.split(“;”);
对于(int i=1;i