Android Content-type Charset不受支持

时间:2015-01-25 16:21:07

标签: android json utf-8 character-encoding

我收到了UnsupportedEncodingException,因为我将其作为内容类型Content-Type: application/json;charset=UTF-8'而不是正确的application/json;charset=UTF-8返回(请注意'在结尾处字符集)。有没有办法忽略这个不受支持的角色?

我收集数据的方式是:

private static String download(String theUrl, String errorMessage) 
{
    String result = "";
    HttpParams httpParameters = new BasicHttpParams();
    HttpConnectionParams.setConnectionTimeout(httpParameters, Integer.parseInt(connectionTimeOut + "000"));
    HttpClient client = new CustomHttpClient(httpParameters).getNewHttpClient();
    HttpGet request = new HttpGet(theUrl);
    ResponseHandler<String> handler = new BasicResponseHandler();
    result = client.execute(request, handler);
    return result;

}

0 个答案:

没有答案