Re: Fwd: i18n
Steven Armstrong <[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.devel |
|---|---|
| Message-ID | <[email protected]> |
Bill Mill wrote: <snip> >> >>As far I can tell pyblosxom doesn't set any headers related to charsets >>or encoding. >> >>Apache on the other hand does, depending on your httpd.conf >> >>http://httpd.apache.org/docs/mod/core.html#adddefaultcharset >> > > > hmmm, ok. Should we be taking control of this header? I thought that > pyblosxom took control of all the headers sent to the broswer; why > wouldn't we? If blog entries are encoded in utf-8, but apache's > sending iso-8859-1 to the browser, it doesn't do us much good to read > the files in utf-8, right? > > (I'm kind of thinking out loud there, but if anybody follows me, just > holler. I'm having a hell of a time getting the comments module to > work with utf-8, and don't look forward to tackling the rest of > pyblosxom. This explains my lack of progress on the comment admin tool > and my proposed changes to comments.py, by the way.) > > I just saw that pyblosxom uses the config.py['blog_encoding'] to choose a stream_writer (codecs module) in the BlosxomRenderer. We could also use that to set a header like Content-type: text/html; charset=$blog_encoding instead of just: Content-type: text/html I've made a quick test, and this seems to work. When adding a header like: Content-type: text/html; charset=utf-8 Firefox reports the page to be UTF-8 encoded. Omitting the charset it's reported as ISO-8859-1. cheers Steven ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl