9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] utf-8 text files from httpd
Date: Sun, 18 Oct 2009 21:37:04 -0400	[thread overview]
Message-ID: <bba363b754289a8c0073322ec2afd7d6@brasstown.quanstro.net> (raw)
In-Reply-To: <<fe41879c0910181734l6363baebsa896bda992d690@mail.gmail.com>>

On Sun Oct 18 20:37:23 EDT 2009, akumar@mail.nanosouffle.net 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	other threads:[~2009-10-19  1:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <<fe41879c0910181734l6363baebsa896bda992d690@mail.gmail.com>
2009-10-19  1:37 ` erik quanstrom [this message]
2009-10-19 10:00   ` Akshat Kumar
2009-10-19 12:45     ` Kenji Arisawa
     [not found] <<df49a7370910190732i526a15b6o6d2822cd2d14bff0@mail.gmail.com>
2009-10-19 14:50 ` erik quanstrom
     [not found] <<df49a7370910190649k3179f0b1r4c877d5ca72af232@mail.gmail.com>
2009-10-19 13:55 ` erik quanstrom
2009-10-19 14:32   ` roger peppe
2009-10-19 17:36     ` lucio
     [not found] <<fe41879c0910190300l51480646pf9630e90c6f30207@mail.gmail.com>
2009-10-19 13:14 ` erik quanstrom
2009-10-19 13:49   ` roger peppe
2009-10-19  9:05 Eris Discordia
     [not found] <<A6127A93-8E78-4E11-9284-56A16D2A2093@ar.aichi-u.ac.jp>
2009-10-19  4:46 ` erik quanstrom
  -- strict thread matches above, loose matches on Subject: below --
2009-10-19  0:34 Akshat Kumar
2009-10-19  1:39 ` andrey mirtchovski
2009-10-19  2:16 ` Kenji Arisawa
2009-10-19  3:35   ` Kenji Arisawa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bba363b754289a8c0073322ec2afd7d6@brasstown.quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).