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. -- Robin Becker
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 - ---------------------------------------------------
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. <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
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 - ---------------------------------------------------
In article <Pine.LNX.4.10.9907291249410.1080-100000@scrawl.codeit.com>, Scott Robertson <sroberts@codeit.com> writes I tried exactly as you suggested and it bombs exactly as before. I am using the latest cvs zope2 with win95 osr2, netscape 4.5. I guess this must be a real bug, but I will check all other avenues first. The doc dosen't even look like HTML any more and doesn't display properly with netscape as a file. I can't think this is right.
***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
-----------------------------------
-- Robin Becker
To cut a long story short. On my win95 machine with netscape 4.5 the following is viewable when opened as a file. From inside Zope Netscape produces a file save dialog box. IE5 doesn't have this problem. The strange characters 0x92 etc come because I saved as html. Can someone confirm that this is the case. <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html"> <TITLE>GENERATIONAL ACCOUNTS</TITLE> </HEAD> <BODY> <p> This is the test Document. </p> </BODY> </HTML> -- Robin Becker
<HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html"> <TITLE>GENERATIONAL ACCOUNTS</TITLE> </HEAD> <!--#call "RESPONSE.setHeader('Content-type','text/html')"--> <BODY> <p> This is the test Document. </p> </BODY> </HTML> ok this is viewable by netscape for me via Zope so it seems Zope is making decisions about content type based on what it sees not what I tell it in the meta things. -- Robin Becker
At 04:06 31-7-99 , Robin Becker wrote:
This is the test Document. �
</HTML>
ok this is viewable by netscape for me via Zope so it seems Zope is making decisions about content type based on what it sees not what I tell it in the meta things.
Have you tried <dtml-call "RESPONSE.setHeader('content-type', 'text/html')"> ? Judging from the source, that would override Zope's content guessing game. Of course, Word should convert the 0x92 character to an HTML entity anyway, but hey, we spend our lives dedicated to circumventing closed source bugs (be it Microsoft or Netscape.. I am glad they started from scratch with the Mozilla project). -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | T: +31 35 7502100 F: +31 35 7502111 | mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ---------------------------------------------
In article <4.1.19990731064425.0092cc30@mail.atmm.nl>, Martijn Pieters <mj@antraciet.nl> writes
At 04:06 31-7-99 , Robin Becker wrote:
This is the test Document.
</HTML>
ok this is viewable by netscape for me via Zope so it seems Zope is making decisions about content type based on what it sees not what I tell it in the meta things.
Have you tried <dtml-call "RESPONSE.setHeader('content-type', 'text/html')"> ? Judging from the source, that would override Zope's content guessing game. yes that's the only thing that works. I used sockspy to see that Zope would otherwise have changed the content type to octal/bytes
Of course, Word should convert the 0x92 character to an HTML entity anyway, but hey, we spend our lives dedicated to circumventing closed source bugs (be it Microsoft or Netscape.. I am glad they started from scratch with the Mozilla project).
-- Robin Becker
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.
There's utility somewhere, IIRC, that fixes all those wierd chars from Windows in HTML. Try searching through Freshmeat. -- Itamar - itamars@ibm.net ----------------------------o----------------------------------------------o Sealingwax Greeting Cards | Trust? Ha! The US dollar is backed by ICBMs! | http://www.sealingwax.com | --Anonymous Coward, Slashdot |
In article <37A361B2.45A9E28C@ibm.net>, Itamar S.-T. <itamars@ibm.net> writes
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.
There's utility somewhere, IIRC, that fixes all those wierd chars from Windows in HTML. Try searching through Freshmeat.
the upshot of this is don't use word to save as html as it won't be transferable to netscape via zope. -- Robin Becker
From the standpoint of a Japanese Zope user:
Would it be unreasonable to suggest that the default MIME type assigned by Zope to documents containing 'binary' information (i.e. 8-bit characters) be something other than 'application/x-octet-stream'? I don't know if there's a better way of doing this, but since most Zope documents don't have a file extension, the MIME type of the document is detected by looking at the content in the case of DTML Documents and Methods - I don't know what the case is with other non-US character sets, but this cause me problems... My temporary fix is to change the default MIME type (in $ZOPE/lib/python/OFS/content_types.py) to 'text/html'. That way, my Japanese documents come out in Japanese. -Brian Hooper Digital Garage, Inc. Robin Becker <robin@jessikat.demon.co.uk> wrote:
In article <37A361B2.45A9E28C@ibm.net>, Itamar S.-T. <itamars@ibm.net> writes
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.
There's utility somewhere, IIRC, that fixes all those wierd chars from Windows in HTML. Try searching through Freshmeat.
the upshot of this is don't use word to save as html as it won't be transferable to netscape via zope. -- Robin Becker
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://www.zope.org/mailman/listinfo/zope-dev
(To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For non-developer, user-level issues, zope@zope.org, http://www.zope.org/mailman/listinfo/zope )
On Sun, 1 Aug 1999, Brian Hooper wrote:
From the standpoint of a Japanese Zope user:
Would it be unreasonable to suggest that the default MIME type assigned by Zope to documents containing 'binary' information (i.e. 8-bit characters) be something other than 'application/x-octet-stream'? I don't know if there's a better way of doing this, but since most Zope documents don't have a file extension, the MIME type of the document is detected by looking at the content in the case of DTML Documents and Methods - I don't know what the case is with other non-US character sets, but this cause me problems...
My temporary fix is to change the default MIME type (in $ZOPE/lib/python/OFS/content_types.py) to 'text/html'. That way, my Japanese documents come out in Japanese. Well, you could add
<dtml-call "RESPONSE.set('content-type','text/html')"> to your standard_html_header. Actually, we did hit this problem too, but only when one of our sales types was trying out ZOPE (to know what he is selling ;) ), and Win98/IE5 added some curious characters. OTOH, developing for ISOLATIN1 with X11/Netscape never provoked this kind of problems. (Even more curious is, that IE5 DOES display application/octet-stream as HTML, even with a missing <HTML> and <BODY> tag it seems ;) ) Andreas -- Andreas Kostyrka | andreas@mtg.co.at phone: +54/1/7070750 | phone: +43/676/4091256 MTG Handelsges.m.b.H. | fax: +43/1/7065299 Raiffeisenstr. 16/9 | 2320 Zwoelfaxing AUSTRIA
In article <Pine.LNX.4.10.9908011003460.26507-100000@gatekeeper.zwax.mtg .co.at>, Andreas Kostyrka <andreas@mtg.co.at> writes
On Sun, 1 Aug 1999, Brian Hooper wrote:
From the standpoint of a Japanese Zope user:
... Well, you could add
<dtml-call "RESPONSE.set('content-type','text/html')">
to your standard_html_header. it would seem reasonable for the default to be html the odd case being binary Actually, we did hit this problem too, but only when one of our sales types was trying out ZOPE (to know what he is selling ;) ), and Win98/IE5 added some curious characters. OTOH, developing for ISOLATIN1 with X11/Netscape never provoked this kind of problems.
(Even more curious is, that IE5 DOES display application/octet-stream as HTML, even with a missing <HTML> and <BODY> tag it seems ;) )
yes I found IE5 displayed correctly, another Bill attempt to discredit the opposition ;)
Andreas -- Andreas Kostyrka | andreas@mtg.co.at phone: +54/1/7070750 | phone: +43/676/4091256 MTG Handelsges.m.b.H. | fax: +43/1/7065299 Raiffeisenstr. 16/9 | 2320 Zwoelfaxing AUSTRIA
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://www.zope.org/mailman/listinfo/zope-dev
(To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For non-developer, user-level issues, zope@zope.org, http://www.zope.org/mailman/listinfo/zope )
-- Robin Becker
On Sun, 1 Aug 1999, Robin Becker wrote:
<dtml-call "RESPONSE.set('content-type','text/html')">
to your standard_html_header. it would seem reasonable for the default to be html the odd case being binary Actually, it works as follows: If it contains ``binary'' characters, it's binary. If it contains <HTML>, it's text/html. Else it's text/plain.
(Even more curious is, that IE5 DOES display application/octet-stream as HTML, even with a missing <HTML> and <BODY> tag it seems ;) )
yes I found IE5 displayed correctly, another Bill attempt to discredit Well, I don't know if displaying a binary like say a .EXE file as ascii seems reasonable.
Andreas -- Andreas Kostyrka | andreas@mtg.co.at phone: +43/1/7070750 | phone: +43/676/4091256 MTG Handelsges.m.b.H. | fax: +43/1/7065299 Raiffeisenstr. 16/9 | 2320 Zwoelfaxing AUSTRIA
Hi Andreas,
Well, you could add
<dtml-call "RESPONSE.set('content-type','text/html')">
to your standard_html_header. Thanks, this was obvious, I should have thought of this!
One comment though - couldn't this work better if documents with <HTML> were considered HTML documents, even if they contain 'binary' data? In other words, if the order of the document-type checks was changed, wouldn't everyone come out happy? --Brian
participants (6)
-
Andreas Kostyrka -
Brian Hooper -
Itamar S.-T. -
Martijn Pieters -
Robin Becker -
Scott Robertson