problems with accents when running php

4

Good morning guys, I'm having trouble executing the code php in browser , in any browser, it does not recognize the accent. It was necessary to use the following line of code so that the accent was recognized: header('Content-Type: text/html; charset=UTF-8') ; But I wanted a somewhat more definitive solution, in which I would not have to always make use of this line. And detail I'm using a Linux Ubuntu distribution with LAMP server .

    
asked by anonymous 14.01.2016 / 13:30

1 answer

2

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

AddDefaultCharset UTF-8 or AddDefaultCharset ISO-8859-1 (for the default pt-br).

Restart Apache

    
14.01.2016 / 14:39