The problem with the Portuguese encoding

I got a headache with a damn phrase.

Portuguese charset = iso-8859-1

In my HTML, I:

<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" /> 

In my config.php:

$config['charset'] = 'ISO-8859-1'; 

I have a word ‘café’, coffee.

It is displayed as: cafŽ.

Any ideas ?!

Thanks in advance for your help.

** Edit

I don't know if it matters, but I use Eclipse

+3
source share
6 answers

What is the file encoding in Eclipse? Right-click on the file in Eclipse, select "Properties". It should be the same as in the meta tag.

+3
source

Thank you very much, I think your answer is the best:

$string = 'café'; 
utf8_decode($string); 

OR

$string = 'café'; 
utf8_encode($string);

with a metacode in the header of each file, the problem with port symbols will be solved.

+2
source
+1

, ISO-8859-15 UTF8. , ​​ ISO-8859-1 UTF8.

-, ? mySQL, , , latin1 utf8? UTF8- ( - PHP),

$string = 'café';
utf8_decode($string);

$string = 'café';
utf8_encode($string);

UTF8 , , PHPs utf8_encode() utf8_decode(), , .

If the utf8_encode or utf8_decode functions work, you should look at your input method and input encoding, as you are likely to find a problem there.

PS From time to time I have the same problems as in Brazil ... I feel your pain!

+1
source

Try it here:

$string = 'café';
htmlentities($string, ENT_COMPAT, 'utf-8');

Be careful!

0
source

Go to the resource package in the project explorer, then right-click on this file and change char to utf = 8 and then save the settings.

0
source

All Articles