[Zope-dev] Strange Characters and Zope

Scott Robertson sroberts@codeit.com
Thu, 29 Jul 1999 12:51:44 -0700 (PDT)


On Fri, 30 Jul 1999, Robin Becker wrote:

> In article <Pine.LNX.4.04.9907301122490.27682-100000@scrawl.codeit.com>, Scott
> Robertson <sroberts@codeit.com> writes
> >On Fri, 30 Jul 1999, Robin Becker wrote:
> >
> >> I was demonstrating the implementation in Zope of my Generational
> >> Accounting web model. The Academic saw how marvellous it was and wanted
> >> immediately to change some of the text in the pages. It was in word so I
> >> said 'save as html' and then we'll hack it into the database pages.
> >> Foolish me. Word inserts many strange characters into it's version of
> >> HTML. One of them being ’ character 0x92. This causes the page to start
> >> flinging out save as dialogs.
> >> 
> >> Can someone enlighten me as to what characters may be safely
> >> embedded/used in Zope DTML. We figured 0x92 fairly easily. The next
> >> document had something else weird and I haven't yet found out what.
> >
> >Hi Robin,
> >
> >If you put this at the top of the DTML Method/Document it should fix your
> >problem. 
> >
> >Content-type: text/html
> >
> >
> >Make sure that that line is the first line and it has at least one blank
> >line before the the rest of the document content.
> >
> >What is happening is that Zope tries to determine the HTML headers for you
> >and it detects the strange MicroSoft cruft and decides that it's a binary
> >file. Zope well see the line above and use that as the header for your
> >document instead of trying to guess it for you.
> >
> >---------------------------------------------------
> >- Scott Robertson             Phone: 714.972.2299 -
> >- CodeIt Computing            Fax:   714.972.2399 -
> >-                http://codeit.com                -
> >---------------------------------------------------
> >
> so the standard header etc is no protection at all? Where should the content type
> spec go.


> my test dtml doc looks like (displays perfectly under netscape directly), but fails
> when viewed via Zope.

***Make it look like this***
Content-type: text/html

 
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<META NAME="Generator" CONTENT="Microsoft Word 97">
<TITLE>GENERATIONAL ACCOUNTS</TITLE>
</HEAD>
<BODY>
<p>
This is the test Document.
’
</p>
 </BODY>
 </HTML>
 -- 
Robin Becker

---------------------------------------------------
- Scott Robertson             Phone: 714.972.2299 -
- CodeIt Computing            Fax:   714.972.2399 -
-                http://codeit.com                -
---------------------------------------------------