accent problems when running php

Asked

Viewed 648 times

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 charset of HTML ?

  • Is your file saved NO GOOD? are you taking this data from a database? you have set the charset in html?

  • 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.

  • You saw the tip I gave and the one Rafael gave ?

  • 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.

1 answer

2

include or change the line in the file /etc/apache2/conf. d/charset

Adddefaultcharset UTF-8 or Adddefaultcharset ISO-8859-1 ( for the en standard).

Restart the Apache

Browser other questions tagged

You are not signed in. Login or sign up in order to post.