title: How to Set Character Encoding to UTF-8 for JSONObject in the Android
body: <p>i need to show text in a UTF-8 Character Encoding in the android App, Here is my Code for JSONAsyncTask in:</p>
  
  <pre><code>class JSONAsyncTask extends AsyncTask&lt;String, Void, Boolean&gt; {
  
      ProgressDialog dialog;
  
      @Override
      protected void onPreExecute() {
          super.onPreExecute();
          dialog = new ProgressDialog(getActivity());
          dialog.setMessage("Wait...");
          dialog.setTitle("Loading");
          dialog.show();
          dialog.setCancelable(false);
      }
  
      @Override
      protected Boolean doInBackground(String... urls) {
          try {
              HttpGet httppost = new HttpGet(urls[0]);
              HttpClient httpclient = new DefaultHttpClient();
              HttpResponse response = httpclient.execute(httppost);
              int status = response.getStatusLine().getStatusCode();
              if (status == 200) {
                  HttpEntity entity = response.getEntity();
                  String data = EntityUtils.toString(entity);
                  JSONObject jsono = new JSONObject(data);
                  JSONArray jarray = jsono.getJSONArray("news");
                  for (int i = 0; i &lt; jarray.length(); i++) {
                      JSONObject object = jarray.getJSONObject(i);
  
                      News news = new News();
  
                      news.setTitle(object.getString("title"));
                      news.setDescription(object.getString("description"));
                      news.setDate(object.getString("date"));
                      news.setImage(object.getString("image"));
  
                      newsList.add(news);
                  }
                  return true;
              }
  
          } catch (ParseException e1) {
              e1.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          } catch (JSONException e) {
              e.printStackTrace();
          }
  
          return false;
      }
  </code></pre>
  
  <p>Of course, Before i'm Asking, research and see these result:</p>
  
  <ul>
  <li><p><a href="https://stackoverflow.com/questions/88838/how-to-convert-strings-to-and-from-utf8-byte-arrays-in-java">How to convert Strings to and from UTF8 byte arrays in Java</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/34687466/converting-string-to-android-jsonobject-loses-utf-8">Converting String to Android JSONObject loses utf-8</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/19182680/encoding-json-to-support-utf-8-characters-in-an-android-app">Encoding JSON to support UTF-8 characters in an android app</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/9069799/android-json-charset-utf-8-problems">Android JSON CharSet UTF-8 problems</a></p></li>
  </ul>
  
  <p>and many more... But that answers can't solve my problem.</p>
  
  <p><a href="https://i.stack.imgur.com/FVn7X.png" rel="nofollow noreferrer">Screenshot</a></p>