MYSQL in server not read "Ç" in query

34 views Asked by At

I did make a test with my server aplication (node) in localhost and everything run well, but when I run it online (EC2 - UBUNTU), "Ç" character isn't read (replaced for anothers). This happens when I call a query (I use KNEX.js and MYSQL2).

I check the query directly in MYSQL without node and run well. In DB the data is right. I try set "charset" in connection with: utf8, utf8_general_ci, latin_general_ci but not run well

The only difference between the localhost to online server that I can see is the system (Windows in localhost). How to check if it's the problem?

Exemple of the problem: I desire "ACLIMAÇÃO" (THE SAME WAY IN DB). I get "ACLIMAÂÂO", some times "ACLIMAÃ\x87Ã\x83O" when I change the "charset" in connection

1

There are 1 answers

1
AndreaCavallo.class On
  1. Check if MySQL is set to use UTF-8. You can check this by running the query SHOW VARIABLES LIKE 'character_set%';. The relevant variables should be set to utf8 or utf8mb4.
  2. Similarly, check the collation settings using SHOW VARIABLES LIKE 'collation%'; They should be compatible with UTF-8 (e.g., utf8_general_ci)