0
Hello! My problem is this: I have a list of values in an external php file and when I use a include to call the values in my template the accented characters are replaced by queries. I wonder if there is a function or another way to get the values encoding them to UTF8.
Example:
$lang = array();
$lang['LANGUAGE'] = 'português';
$lang['HOME'] = 'início';
and within the template call so:
include 'lista.php';
echo $lang['HOME'];
Hence appears Inic? the
NOTE: I used Notepad++ to format them in UTF-8 without good and solved in most words, however in texts from inside buttons did not work. See in the image:
tried to save the file with utf-8 without good? I saved so, I stopped having problems with accent a long time after I started saving everything with utf-8 no good
– flourigh
Yes I used Notepad++ to format them and it worked in most sentences, however for the words inside buttons did not work.
– valpmg
inside the buttons? you say, input type button? tried to use this in the header of your <meta charset='utf-8 file' /> ?
– flourigh
I put the image in the question, see. In the header of my site the charset is ok. the error only occurs with words pulled from the external array of the.php list file, the words inside the template works normally.
– valpmg
Could you show me the link to your website? and try to put this code in include to see if it works <?php header('Content-Type: text/html; charset=utf-8'); include 'list.php'; ?>
– flourigh
Dude, I found a guy with a problem very similar to yours on this link http://forum.imasters.com.br/topic/283085-solved-accentucao-utf-8-e-iso/
– flourigh
Use wordpress. I will try this code there that you passed to see.
– valpmg
Try this on the link if you do not post the other http://br.phptherightway.com/#php_e_utf8 files
– Leonardo
Usually it is server conflict with encoding, already solved this with ANSI instead of UTF-8 in the meta tag, another alternative is to encode the output example: utf8_encode($output);
– Felipe Duarte
Felipe already tried those two options there that you mentioned, also did not give. I’m trying locally with easy php and you said it might be server conflict, is that why it’s not working?
– valpmg