3

I am working on an Android app that sends data to a remote server. The app sends and receives the data in the correct way. Example: sends "Juárez" and receives "Juárez", but the data are stored in the database as "Juárez",

That should be no problem so far, the issue is that the same data should be shown at a web site, and there it is shown as "Juárez".

I have tried several options including

$con->set_charset("utf8");
SET NAMES utf8;

just after the MySQL connection,

I have tried also this:

$ad1 = utf8_encode ($_POST['ad1']);

But I am getting the same strange String in the database.

Any help is welcome

mvasco
  • 4,965
  • 7
  • 59
  • 120
  • All it takes, is one wrong charset in your application - everything needs to be the same! I have previously written [**an answer about UTF-8 encoding**](https://stackoverflow.com/a/31899827/4535200) that contains a little checklist, that will cover *most* of the charset issues in a PHP/MySQL application. There's also a more in-depth topic, [**UTF-8 All the Way Through**](https://stackoverflow.com/q/279170/4535200). Most likely, you'll find a solution in either one or both of these topics. – Qirel Sep 25 '17 at 18:16
  • Possible duplicate of [UTF-8 all the way through](https://stackoverflow.com/questions/279170/utf-8-all-the-way-through) – Qirel Sep 25 '17 at 18:18
  • I guess the problem lies on the way the app is sending the data. I will try to clean the JSON file – mvasco Sep 25 '17 at 18:23
  • what's your database collation? – user1506104 Sep 26 '17 at 07:13

0 Answers0