Un problema muchas veces repetido cuando no trabajas en ingles y ASCII. No siempre se controla la codificacion que se usa en distintos entornos de trabajo y produccion; al final acaban apareciendo caracteres extraños y problemas de codificacion.
Working with many development and production some people forgets to check their default charsets; in the end encoding mismatchs crawl. I’ve seen a few programmers falling in this trap.
Last time our php was Latin-1 encoded and the production Apache server used Utf-8 by default. In a shared hosting environments the default encoding can be set from the .htaccess file:
AddCharset ISO-8859-1 .php
AddDefaultCharset ISO-8859-1
Same thing from php:
PHP. Use the header() function before generating any content, e.g.:
header(’Content-type: text/html; charset=utf-8′);
Links and discussion:
- Basics on http charset parameter at w3c.
- Apache .htacces usage.
- Handy list of IANA accepted encoding names recognized by apache.
