On Sun Oct 18 20:37:23 EDT 2009, [email protected] wrote:
> I'm trying to put up a plain text file containing UTF-8
> characters from httpd, but when viewing it from any
> browser, it comes off as an ASCII file that needs to
> be downloaded (so, those characters are garbled).
> Is this due to some behaviour of httpd?

httpd(8) is dropping the ball on this one, and i don't
see an easy way to fix it without a hack, since the
specification of /sys/lib/mimetype lacks a way to add
a charset.

(as /sys/lib/mimetype(6) is missing, it's somewhat of
a guess what the format really is.)

httpd is (again) being one step too cute, relying on the
suffix of the file, rather than the output of file(1).
but if it did, we would be dealing with a bug in file.
it returns "short Ascii" for a file with the contents
"fu☺".

there is already a hack in /sys/src/cmd/ip/httpd/sendfd.c
but it's commented out.  i am not sure why.  that hack
should never cause problems today and can only solve
them.

i'd recommend submitting a patch without the comment.

- erik

* if you haven't chased a nonexistant httpd.rewrite bug
because httpd was caching /sys/lib/httpd.rewrite and you'd
forgotten to issue the magic 50 spurious requests, you likely
haven't used it.

Reply via email to