Forum Moderators: phranque

Message Too Old, No Replies

Apache2 and Cyrillic Fonts koi8

Cannot get Apache to send koi8 encoding properly

         

Fredrick

12:35 pm on Aug 31, 2005 (gmt 0)

10+ Year Member



Hi everyone,

I have an apache version 2.0.49 running on a Linux/SUSE box.

I am doing a translation of a Website into Russian.(don't speak it, just copying and pasting). The pages are supposed to be displayed in a Cyrillic font.
Creating the pages and calling them locally works fine. The Pages are encoded with: <meta HTTP-EQUIV="Content-Type" content="text/html; charset=KOI8-R">
When I put them online though, the characters are all garbled, even I can tell that they aren't Cyrillic.
If I rename the pages to end on html.ru.koi8-r and call these pages directly as in: [ru.example.com...] they are displayed correctly. The same call to index.htm does not.

Obviously Apache is capable of sending the correct encoding, but I seem to have to set something for it to do so with 'normal' pages.

Can anybody help?

Thanks

Fredrick

[edited by: jdMorgan at 1:27 pm (utc) on Aug. 31, 2005]
[edit reason] Obscured specifics per TOS. [/edit]

encyclo

12:49 pm on Aug 31, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to the forums Fredrick!

Your problem sounds like a server configuration problem. If the server is automatically setting a default charset in a HTTP header before the page is served, that charset will override the charset specified in the meta tag.

Try adding the following to an .htaccess file in your document root:

AddDefaultCharset Off

Does that help? If you have a dedicated server, you can also disable the default charset in httpd.conf.

Reference: [httpd.apache.org...]

Other potential problems can occur if the meta charset tag appears after any encoded content - you should place it before the

<title></title>
for example.

Fredrick

1:18 pm on Aug 31, 2005 (gmt 0)

10+ Year Member



Thank you for the Welcome and thank you for the prompt reply!

I set AddDefaultCharset to Off. The pages are now diplayed in what looks very Russian to me.

Thanks for the help.

Fredrick

Omut

10:56 am on Sep 4, 2005 (gmt 0)

10+ Year Member



BTW "Windows-1251" character set is a de-facto encoding for Cyrillic alphabet in Russia.

KOI8-R charset is widely supported, but it is come from DOS epoch.

Fredrick

11:12 am on Sep 4, 2005 (gmt 0)

10+ Year Member



Thanks Omut,

I had started out using character set 1251, but couldn't get the pages to display properly. Now that I know what the problem was I may change the pages back.

regards

...Fredrick