Forum OpenACS Q&A: I can set the charset for .adp, but not for .html

I'm finishing up a project based on OpenACS 3 that has to work in Hebrew, English, and Arabic. We're using Unicode (UTF-8) in PostgreSQL, and so far things are working just great; we have the bboard and other dynamic stuff working without any problem in all three languages.

The problem, ironically, is that HTML pages aren't coming through with the right charset. That is, if I take a page and give it an .adp extension, then the "Content-type" header comes through as

    text/html; charset=utf-8

which is supposed to be the case. But if I rename that same file with an .html extension, the "Content-type" header suddenly becomes

     text/html

which means that the page gets the default Web encoding of Latin-1, which is very clearly wrong.

I can't figure out what I'm doing wrong here. I'm running AOLServer 3.4 (nsd_v3_r4), which might indeed be the problem -- except that my configuration is working perfectly for .adp, and not at all for .html.

Here's what I have in ns/mimetypes:

        ns_param ".tcl" "text/html; charset=utf-8"
        ns_param ".adp" "text/html; charset=utf-8"
        ns_param ".html" "text/html; charset=utf-8"
        ns_param ".htm" "text/html; charset=utf-8"

It's clear that .html files are handled differently from .adp files, but I can't figure out how. Is my only solution to rename everything with an .adp extension? (That's not a horrible solution, but it really won't satisfy my curiosity.)

I realize that OpenACS 3 is on its way out, and I've been rather impressed with what I've had a chance to play with during my limited time. But if anyone can step in and help me here, I would appreciate it!

Collapse
2: Answering my own question (response to 1)
Posted by Reuven Lerner on
There were two flaws in my question, both of which I just answered myself:

- I assumed that I was running the aD-patched version of AOLServer.  I wasn't.  (Grumble, gumble, former employees...)

- I somehow thought that .adp pages were working correctly, when they weren't.

I just spent a few hours with ngrep looking at HTTP headers.  Once it became clear that modifying nsd.tcl wasn't having any effect, I decided to look at the version of AOLServer that I was running.  Son of a gun, I wasn't running the version that I thought I was.  I installed an aD version, and voila!  Works like a champ.