Re: encoding of xml-representation of forms
"Gilles Lenfant" <gilles-jXGkr1x3RBbcr/[email protected]> Fri, 19 Sep 2003 20:24:21 +0200
| Newsgroups | gmane.comp.web.zope.formulator.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi,
If you're in a ZMI page that uses the manage_page_header, you can get it
like this...
REQUEST.get('management_page_charset')
Otherwise you can use...
REQUEST.RESPONSE.headers
...that's a dict of all HTTP headers. The [optional] charset is supposed to
be in the Content-Type header like this...
text/html;charset=iso-8859-1
If no charset is defined, you shoud consider using a default charset chosen
by the user (as in Localizer/MessageCatalog objects)
Anyway, if in ZMI you should prefer the first solution that always provides
a charset.
HTH
--Gilles
"Joachim Schmitz" <[email protected]> a écrit dans
le message de news: [email protected]
Hi,
to get the encoding of the xml-representation of a form right, the
encoding in the xml-header: <?xml version="1.0" encoding="iso-8859"?>
must be the same as in the http-response header. The easiest way to do
this would be to read the current encoding response-header, but there is
only a REQUEST.RESPONSE.setHeader, no getHeader. Any idea how to get the
encoding out of the Response-object ?
--
Mit freundlichen Grüßen Joachim Schmitz
......................................................................
AixtraWare eK ..Joachim Schmitz ..www.aixtraware.de ..t: +49-2464-8851
Hüsgenstr. 33a .....d-52457 Aldenhoven .............f: +49-2464-905163