Error with accented characters

-2

Good afternoon,

The accented characters in my system are not working when I bring it from the database, so , I already tried to put the meta tag, I already tried to save the file with a different encoding, but it does not work ..

NOTE: The text written by me in the code loads correctly, it's just the information that comes from the bank that does not load

NOTE: When I squeeze the query in SQLYog all the accents are there correctly

    
asked by anonymous 21.12.2018 / 20:55

1 answer

1

Use your query method to execute the query

SET NAMES (sua codificação de caracteres EX: utf8); <- isto diz para a conecxão com o banco que os caracteres estão em tal codificação

And in php

mb_http_input("mesma codificação de caracteres do banco");
mb_http_output("mesma codificação de caracteres do banco");
mb_regex_encoding("mesma codificação de caracteres do banco");
mb_internal_encoding("mesma codificação de caracteres do banco");

Remembering that these settings can be made in your php.ini, but if the hosting is shared you probably will not be able to edit it

    
22.12.2018 / 14:42