2014-10-07 3 views
0

내 안드로이드 프로그램에서 웹 페이지를 다운로드하려고합니다. 그러나 웹 페이지는 그리스어()이고, 나는 단지 ??????? 만 얻는다. 답례로.HttpClient로 안드로이드의 그리스어 인코딩

class RequestTask extends AsyncTask<String, String, String>{ 

@Override 
protected String doInBackground(String... uri) { 
    HttpClient httpclient = new DefaultHttpClient(); 
    HttpResponse response; 
    String responseString = null; 
    try { 
     response = httpclient.execute(new HttpGet(uri[0])); 
     StatusLine statusLine = response.getStatusLine(); 
     if(statusLine.getStatusCode() == HttpStatus.SC_OK){ 
      ByteArrayOutputStream out = new ByteArrayOutputStream(); 
      response.getEntity().writeTo(out); 
      out.close(); 
      responseString = out.toString(); 
     } else{ 
      //Closes the connection. 
      response.getEntity().getContent().close(); 
      throw new IOException(statusLine.getReasonPhrase()); 
     } 
    } catch (ClientProtocolException e) { 
     //TODO Handle problems.. 
    } catch (IOException e) { 
     //TODO Handle problems.. 
    } 
    return responseString; 
} 

@Override 
protected void onPostExecute(String result) { 
    super.onPostExecute(result); 
    //Do anything with response.. 
} 

}

웹 서버에 대한 링크는 다음과 같습니다 http://www.cysms.eu/anagram/android/getWR.php

당신이 그리스 텍스트를 제대로하는 방법에 대한 좀 도와 주시겠습니까?

감사합니다, 니 코스

+0

포스트 URL로 응답을 변환하려고합니다. – greenapps

+0

링크가 추가되었습니다. 감사합니다 – Nicos

+0

우리는 무엇을보아야합니까 : ΝΕΦΤΑΚΙ 또는 ΜΑΣΟΥΡΙ? 파이어 폭스가 ΝΕΦΤΑΚΙ를 보여줄 수는 있지만 어떻게 소스를 볼 수 있을까요? ΜΑΣΟΥΡΙ? 더 현실적인 페이지를 만들 수 없습니까? 이 말은 한 마디로 그리스 문자 하나만 있으면 재미가 없습니다. 또한 유효한 HTML 페이지가 없습니다. 괜찮은 페이지를 만드십시오. – greenapps

답변

1

귀하의 웹 서비스는 charset=Windows-1253 가지고 있으며, 안드로이드는 utf-8을 기대하고, 그래서 우리는보고를 가질 수 win1253에서 utf-8

관련 문제