Apache charset negotiation via .var files
Choosing the right document charset in accordance with the
Apache's
As an example, try this
AddType "text/html; charset=koi8-r" .html8 AddType "text/html; charset=windows-1251" .htmlwIf your browser generates proper Accept-Charset field, this example will automatically select
a document in correct character set. When your browser accepts both
KOI8-R and CP1251, the KOI8-R document will be chosen with
the probability of 10%.
URI: a; vary="type" URI: b.html8 Content-Type: text/html; charset=koi8-r; qs=0.1 URI: a.htmlw Content-Type: text/html; charset=windows-1251 It is convenient to store documents in a single character set and convert them on the fly. Sometimes it is possible to load conversion modules directly into HTTPD, but it is very implementation-dependent and may require server re-building, so CGI scripts look like a more general solution for this. In my previous example, instead of two files in different character sets there may be one CGI script that accepts character set as an argument and converts the file correspondingly. For example, you can use the trans Character Encoding Converter Generator Package to convert between most Russian character sets via UNICODE. WARNING: This method requires that correct
| |
|
KOI8-R Setup: OS & applications
(expanded below)
|