2013-07-01 5 views
0

Android Volley API를 사용하여 페이지의 소스 코드에서 아랍어 텍스트를 가져 오는 방법은 무엇입니까 ??Android Volley API UTF-8

감사합니다.

답변

1

리턴 된 기본 문자 세트를 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; 
    } 
관련 문제