The android application through PHP transfers data to the database. But, instead of Russian letters, question marks are displayed. I added mysqli_set_charset ($ con, "utf8") to php, but the problem did not resolve. In the database everywhere utf8. Another point, when checking the code through google postman, the data is displayed correctly both in the database and in the application ..

protected String doInBackground(String... args) { String name = inputName.getText().toString(); String price = inputPrice.getText().toString(); String description = inputDesc.getText().toString(); List<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair("name", name)); params.add(new BasicNameValuePair("price", price)); params.add(new BasicNameValuePair("description", description)); JSONObject json = jsonParser.makeHttpRequest(url_create_product, "POST", params); 
  • Php data reception code can also be added. - YurySPb
  • If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky

1 answer 1

When you send a text from Cyrillic to a php handler via the android application, use URLEncode, for example, sending POST:

 params.add(new BasicNameValuePair("DataText", URLEncoder.encode(Text))); 

When you accept this data in a php handler, you get it in this way:

 $DataText = urldecode($_POST['DataText']);