3

I have a simple html website in a CentOS 6.4 server. In every html page i have set

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

I have already added in a .htaccess file the following line

IndexOptions Charset=UTF-8

and in the httpd.conf file of the site i have added

<VirtualHost *:80>         
    /* other stuff */
    AddDefaultCharset UTF-8
    IndexOptions Charset=UTF-8
</VirtualHost>

In the main httpd.conf the line

AddDefaultCharset UTF-8

is set as well.

Still when i debug in Chrome i get that my request headers are:

Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8

and my response header is:

Content-Type: text/html; charset=iso-8859-1

Accessing the locale command i get

LANG=el_GR.UTF-8
LC_CTYPE="el_GR.UTF-8"
LC_NUMERIC="el_GR.UTF-8"
LC_TIME="el_GR.UTF-8"
LC_COLLATE="el_GR.UTF-8"
LC_MONETARY="el_GR.UTF-8"
LC_MESSAGES="el_GR.UTF-8"
LC_PAPER="el_GR.UTF-8"
LC_NAME="el_GR.UTF-8"
LC_ADDRESS="el_GR.UTF-8"
LC_TELEPHONE="el_GR.UTF-8"
LC_MEASUREMENT="el_GR.UTF-8"
LC_IDENTIFICATION="el_GR.UTF-8"
LC_ALL=

and the /etc/sysconfig/i18n has the following lines

LANG="el_GR.UTF-8"
SYSFONT="latarcyrheb-sun16"

Still every URL that i try to access that its title is in Greek i get a 404 error that a URL /συχνές_εÏωτήσεις.html is not found. The page is there but the encoding does not work for some reason.

I would appreciate any kind help. Thank you

segconn
  • 31
  • 1
  • 3

2 Answers2

1

The IndexOptions directive has only effect for the apache autogenerated directory listings, and nothing to your actual html pages to be served.

Your request doesn't specifies any type of encoding, it shouldn't have any effect to your page generation.

The content (also the actual encoding of your static html file) also shouldn't have change anything, and not its <meta settings.

The only directive which have an effect in your case, is the AddDefaultCharset UTF-8. It had to work. Something is probably overriding this your charset.

What will happen if you serve a simple text file? Will you get an utf8 http reply header with it?

peterh
  • 4,914
  • 13
  • 29
  • 44
0

Check your hmtl file:

file /var/www/html/your_page.html

Maybe your editor saves the Latin-1 encoding.

To change encoding try:

iconv -f ascii -t utf8 [filename] > [newfilename]

or

recode UTF-8 [filename]
lg.
  • 4,579
  • 3
  • 20
  • 20
  • I think that the problem comes on the HTTP request that is made since the server is not responding in UTF-8. – segconn Jul 26 '13 at 12:54