Re: Problem with freewrap and encoding (please just give it a try)
From: Dennis LaBelle (labelled_at_nycap.rr.com)
Date: 10/18/04
- Next message: Melissa Schrumpf: "Re: gzip compressed webpage"
- Previous message: miguel sofer: "Re: [Tcl] exec like in a shell"
- In reply to: Stefano: "Problem with freewrap and encoding (please just give it a try)"
- Next in thread: Stefano: "Re: Problem with freewrap and encoding (please just give it a try)"
- Reply: Stefano: "Re: Problem with freewrap and encoding (please just give it a try)"
- Reply: Dennis LaBelle: "Re: Problem with freewrap and encoding (please just give it a try)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 18 Oct 2004 01:06:34 GMT
Stefano wrote:
> Hi,
> I guess this is my last resort. If no one from this group can answer
> my question I guess I'll have to give up with freewrap. Even if I have
> to admit that this is the only problem I had with it. But I usually
> handle documents written with all kind of european characters, and
> this seems to be a problem for freewrap version 5.61
> (http://freewrap.sourceforge.net). I don't know if older versions are
> bug free, but I don't know how to use encodings with older versions. I
> found a comment of Dennis Labelle (freewrap's author) from 2002 on
> this news group, but now the howto file of freewrap has changed as for
> encodings, so I don't know how I could apply that suggestion.
>
> I would like to know if other people can replicate the "bug" I found,
> or if this is just a problem of my PC configuration.
>
> I wrote a simple routine to get rid of special characters embedded in
> an ASP file. This is the routine:
>
> ##### routine STARTS here
> set autoweb(filename) {scheda0-orig.asp}
> set autoweb(filenameout) {scheda0-out.asp}
>
> set fileId [open $autoweb(filename) "r"]
> set htmlcontent [read $fileId]
> close $fileId
>
> # creates string map array
> set cmap {}
> for {set i 161} {$i < 256} {incr i} {
> lappend cmap [format "%c" $i] "&#$i;"
> }
>
> # convert special characters to HTML codes
> set htmlcontent [string map $cmap $htmlcontent]
>
> # clean ASP code from html document
> regsub -all {<%.*%>} $htmlcontent {} htmlcontent
>
> # writes document back to local file
> set parFileId [open $autoweb(filenameout) w]
> puts $parFileId "${htmlcontent}"
> close $parFileId
>
> exit
> ##### routine ENDS here
>
> When I run this routine in Windows (windows 2000, english version)
> just doubleclicking on the tcl file, everything works fine. I use Tcl
> version 8.4.6. Instead, if I compile with freewrap 5.61, the output
> file will be still readable but will contain some evident garbage
> characters. I created a simplified version of my ASP file. I verified
> that copying and pasting the following code does exactly reproduce the
> problem:
>
> <html>
> <head>
> </head>
> <body>
> <h1>Progetto n°</h1>
> </body>
> </html>
OK, exactly what do you mean by "copying and pasting the following code"?
Those last few lines don't look like any special ASP stuff to me.
And how does "copying and pasting" simulate the problems with some computer
code?
Dennis LaBelle
- Next message: Melissa Schrumpf: "Re: gzip compressed webpage"
- Previous message: miguel sofer: "Re: [Tcl] exec like in a shell"
- In reply to: Stefano: "Problem with freewrap and encoding (please just give it a try)"
- Next in thread: Stefano: "Re: Problem with freewrap and encoding (please just give it a try)"
- Reply: Stefano: "Re: Problem with freewrap and encoding (please just give it a try)"
- Reply: Dennis LaBelle: "Re: Problem with freewrap and encoding (please just give it a try)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|