Accentuation of the database not accepted on the site

0

I have a text in the database but the site does not assume the emphasis of type ã, á, ç and places in the place of those letters some strange characters:

My database is grouped latin1_swedish_ci and the site reads the accents I put directly.

How do I get the site to accept database accent?

    
asked by anonymous 07.09.2016 / 12:10

2 answers

0

There are a number of factors that can influence this problem:

1st - Check the encoding of the text being saved by your text editor; 2nd - Check the coding that is being used in your browser (test in several browsers to make sure the problem is really in the database); 3rd Check the encoding of the database;
4th - Check the encoding of the tables; 5th - Check the encoding of table cells that accept characters;

In extreme cases use functions, either javascript, php or your preferred language to force the bank to enter and exit in the correct encoding.

I recommend using UTF-8 encoding, which is currently the most used by browsers.

    
07.09.2016 / 14:45
0

You are using different charsets on the page and in the database, so the problem; I can think of some solutions:

  • Change the bank to UTF-8. The best solution of all but may not be feasible
  • Change the page (s) to the same bank charset using the corresponding tags. It is not quite the best but depending on how many pages it can be the easiest to implement.
  • Do the charset conversion on the server after reading from the database and before sending the result. It smells like "POG" but it can be a solution. It can be done using specific functions of the language that is doing the query or via bank; mysql, for example, has the "cast" and "convert" functions that allow you to convert data between charsets.
07.09.2016 / 17:25