added encoding support
David Goodger <[email protected]> Tue, 20 Jul 2004 19:36:01 -0400
| Newsgroups | gmane.comp.web.ht2html.devel |
|---|---|
| Message-ID | <[email protected]> |
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigF5C031976845D1BE11E256DE
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
As promised at PyCon in March, I have just checked in support for a
new "Encoding:" header for PDOGenerator.py, defaulting to "latin-1".
At the same time, I simplified the rst_html.py glue code. (Got the
checkin messages mixed up, sorry.) A recent Docutils is needed [1]_,
and Python 2.3+ is required for non-Latin-1 output. For an example of
the input and output, see
http://python.net/~goodger/tmp/test.html
http://python.net/~goodger/tmp/test.ht
If you see garbage characters in the lines between "Python fits your
brain!" and "Python Software Foundation", your OS or browser can't
handle Japanese. If you see garbage characters anywhere else, your OS
or browser is retarded ;-)
No changes to the Makefile are needed.
I thought about extending the "Content-type" header as in email & web
pages, but a new "Encoding" header was easier. Which is better?
Encoding: ISO-8859-1
or
Content-type: text/x-rst; charset=ISO-8859-1
Also, I considered adding support for an Emacs top-turd like
-*- coding: iso-8859-1 -*-
But then the .ht file would no longer be RFC-2822-compliant. Instead,
a bottom-turd works fine:
Local Variables:
coding: utf-8
End:
.. [1] The latest Docutils is *mostly* installed on creosote.
setup.py tried to install the rst2html.py script in /usr/bin, but
permissions prevented it. This brings up a couple of points:
* Why is Distutils installing in /usr/bin, and not /usr/local/bin?
Isn't /usr/local/bin a better default?
* I tried sudo'ing the install, but I don't seem to be on the
sudoers list on creosote. So I couldn't install Docutils for
Python 2.3 at all. Could somebody add me to sudoers please (or
copy my ssh key to root)?
--
David Goodger <http://python.net/~goodger>
--------------enigF5C031976845D1BE11E256DE
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFA/axprqIPjB1FxosRAg+0AJ0fVt24y4C8asM54cYZ8ePRvqXFMQCfcQ4V
j3wH7nfvZVIKUq4XQwZ7+9s=
=o5Ca
-----END PGP SIGNATURE-----
--------------enigF5C031976845D1BE11E256DE--
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click