3

I have upgrade Apache from 2.2 to 2.4 and I am having problems with character encoding. In my pages I have è=è ò=ò ì=ì etc...

In my httpd.conf I have commented the default value and added ISO-8859-1 (Western Europe)

#AddDefaultCharset UTF-8
AddDefaultCharset ISO-8859-1

But this didn't change anything.

  • 1
    Have you checked the HTTP headers actually sent and the actual encoding of the pages? It seems that the pages are actually UTF-8 encoded, so they should be sent with UTF-8 specified as the encoding. – Jukka K. Korpela Jul 9 '14 at 6:59
  • I had already checked: Content-Type: text/html; charset=ISO-8859-1 – hellb0y77 Jul 9 '14 at 7:11
  • 1
    OK, so the setting works. The problem is probably that the actual .html files are UTF-8 encoded. The Apache setting does not cause recoding; it only affects the HTTP headers. – Jukka K. Korpela Jul 9 '14 at 7:13
  • But the files have not been changed and with Apache 2.2 and ISO-8859-1 everything worked perfectly, it all happened after switching to 2.4 – hellb0y77 Jul 9 '14 at 7:18
  • Can you post an example URL? – Jukka K. Korpela Jul 9 '14 at 7:21
10

Are you running php? I think your problem is not in apache httpd.conf but in php.ini.

See this: http://php.net/manual/en/ini.core.php#ini.default-charset "In PHP 5.6 onwards, "UTF-8" is the default value and its value is used as the default character encoding ..."

4

Those two different solutions worked for me :

1° Add this into the vhost:

php_value default_charset ISO-8859-1

2° Put

default_charset = "ISO-8859-1"

into /etc/php5/apache2/php.ini (on Debian)

0

Try adding following option to your vhost config:

php_value default_charset ISO-8859-1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.