4
Good morning guys, I’m having trouble executing the code php in the browser, in any browser, it does not recognize the accent.
It was necessary to use the following line of code for the accent to be recognized: header('Content-Type: text/html; charset=UTF-8');
But I wanted a somewhat more definitive solution, in which it was not necessary to be always making use of this line.
And detail I’m using a distribution Linux Ubuntu with LAMP server.
How’s the
meta charsetof HTML ?– Diego Souza
Is your file saved NO GOOD? are you taking this data from a database? you have set the
charsetin html?– RFL
Hello friends, I am not taking this data from the database, Although I started to develop code in php in Ubuntu today and I have already come across this problem and I am looking for a solution.
– Anelisa
You saw the tip I gave and the one Rafael gave ?
– Diego Souza
Anelisa to leave permanent, you have to set the header directly in Apache. See Apache documentation and @André response. Make sure you don’t use <meta> for this on the page until you’ve tidied up the header, so there’s no confusion.
– Bacco