The problem is that I send JSON to the database, and there instead of Cyrillic question marks.
I type like this:
ArrayList<String> arrayList = new ArrayList<>(); arraylist.add("first"); arraylist.add("second"); arraylist.add("third"); arraylist.add("fourth"); Then I convert ArrayList to Json
String jsonString = new Gson().toJson(arrayList); Sending:
HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(Application.TEST_API); List<NameValuePair> valuePairs = new ArrayList<>(); valuePairs.add(new BasicNameValuePair("request", "SAVE_RESULT")); valuePairs.add(new BasicNameValuePair("result", jsonString)); httppost.setEntity(new UrlEncodedFormEntity(valuePairs)); HttpResponse httpResponse = httpclient.execute(httppost); Question:
1) How to jsonString my array to UTF-8 in jsonString ?
2) Or a problem when sending, where httppost.setEntity(new UrlEncodedFormEntity(valuePairs)) , since, UrlEncodedFormEntity()
public UrlEncodedFormEntity(List<? extends NameValuePair> parameters) throws UnsupportedEncodingException { this(parameters, "ISO-8859-1"); }