Problem UTF-8 and iso-8859-1

0

I have had a web page that had the following code in the head:

<head>
<!--COMIENZO: CABECERA USUARIO-->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!--FIN: CABECERA USUARIO-->
<!--METAINFORMACION DE LA PAGINA-->
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
</head>

But on the server it does not work, could it be Apache's problem? Because I have tried to use the following code:

<head>
<!--COMIENZO: CABECERA USUARIO-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--FIN: CABECERA USUARIO-->
<!--METAINFORMACION DE LA PAGINA-->
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
    
asked by Oscar Sanclemente 30.03.2017 в 12:05
source

2 answers

1

The html code is fine and should take the accents, the ñ and other characters. According to my experience these things fail when you are trying to bring texts from the source code for example a page in utf-8 and it puts text in iso-8859-1

If you use php for example. the transformation of a charset can cause problems by a different format in the database

<?PHP 
   $contenido = “ÑñÑñ papá”
   echo iconv(mb_detect_encoding($contenido, mb_detect_order(), true),   "UTF-8", $contenido);

This corrects charset errors and forces it to be in utf-8

    
answered by 30.03.2017 в 13:32
0

I think you should change the format of the html or php file. When you had it in the old format, UTF-8, your file coding will remain the same. If you are under submime or a note pad, go to File > Coding > UTF-8

    
answered by 25.05.2017 в 01:12