Re: document charset and Cache-Control: no-cache

> Amaya implements the standard policy:
> 1. Charset given in HTTP header

My CGI program works that way, the header is

    Content-Type: text/html; charset=utf-8

and the documents are HTML 4.

The strange thing is, that the encoding in a certain case seems not to
be recognized by Amaya: If the CGI program declares an additional HTTP
header

    Cache-Control: no-cache

, charset information seems to be ignored: The document is displayed
using the iso-8859-1 charset, and the `Document Information' window
shows "Charset: Unknown".

Is this what I should expect, when I use the Cache-Control header?


I have attached an example CGI script. If the `X-' prefix is removed,
so that the Cache-Control header gets active, Amaya forgets about the 
`charset=utf-8', at least on my system.

Michael
-- 
#! /bin/sh

charset="utf-8"

cat <<EOF
Content-Type: text/html; charset=$charset
X-Cache-Control: no-cache

<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
  <head>
    <title>Charset-Test</title>
  </head>
  <body>
    <pre>
charset: $charset

Should be an \`a' with diaeresis:
EOF

printf "  \xc3\xa4\n"

cat <<EOF

`date`
    </pre>
  </body>
</html>
EOF

Received on Saturday, 18 February 2006 18:08:34 UTC