docker-lamp icon indicating copy to clipboard operation
docker-lamp copied to clipboard

Charset Issues

Open msahores opened this issue 5 years ago • 1 comments

Hi, do you know how can I get charset support for Spanish characters? Thanks!

msahores avatar Oct 15 '20 19:10 msahores

Hi. Have you tried the directive AddDefaultCharset utf-8?

I tested it on the image mattrayner/lamp:latest-1804 (05750cfa54d5).

$ alias d='sudo docker exec -it container_name' # make it easier
$ d sh -c "echo 'Traducción al inglés.' > /app/spanish.html" # prepare the webpage

First I used utf-8,

$ d sed -i '$a\AddDefaultCharset utf-8' /etc/apache2/apache2.conf # append the directive at the end of the file
$ d service apache2 restart
Traducción al inglés.

And then I switched to iso-8859-1,

$ d sed -i '$s#utf-8#iso-8859-1#' /etc/apache2/apache2.conf # do substitute at the end of the file
$ d service apache2 restart
Traducción al inglés.

Modifying the file apache2.conf is not the only way, please refer to:

pzhlkj6612 avatar Oct 16 '20 00:10 pzhlkj6612