PHP 웹 서비스의 JSON 응답에서 어포 스트로피 대신 & # 039가 표시됩니다. 어떻게 JSON 응답을 안드로이드의 특수 문자로 파싱 할 수 있습니까?webservices에서 json 응답의 특수 문자를 구문 분석하십시오.
편집
내 HTTP 연결 방법 코드 -
InputStream is = null;
String response = null,value = null;
try {
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet httpPost = new HttpGet(url);
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
is = httpEntity.getContent();
}
catch (UnknownHostException e) {
e.printStackTrace();
}
catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"), 8);
String line = null;
while ((line = reader.readLine()) != null) {
value=line.trim();
}
is.close();
response = URLEncoder.encode(value,"UTF-8");
} catch (Exception e) {
Log.e("Buffer Error", "Error converting result " + e.toString());
}
응답에 영향 URLDecoder 적용하고 응답 URLEncoder와 함께 할 때 일부 기호 및 추가 숯불 % 20D (같은 appeded 있습니다 /). 우리가 이것을 할 수있는 html로 클래스를 사용
URLDecoder를 사용하여 –
URL을 제공해주십시오. –