Re: Problem with freewrap and encoding (please just give it a try)

From: Stefano (s_federici_at_yahoo.com)
Date: 10/18/04


Date: 18 Oct 2004 02:46:14 -0700

Hi Dennis,
thanks a lot for your answer.

> 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?

By copying and pasting I meant copying the following HTML lines

<html>
<head>
</head>
<body>
<h1>Progetto n°</h1>
</body>
</html>

and saving them as "scheda0-orig.asp" (the name of the input file of
my sample code). Sorry, I realize that this was not obvious. It it
true that you don't see any ASP code in it. I created this short
HTML-only file to show the problem I had by trying to filter out all
ASP code contained in a ASP file. I had started with the following
simple code:

##### 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
 
# 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

Then I found that, by running the compiled version of this Tcl code,
all special characters (such as the "°" character inside the <h1> tag)
where replaced by some other chars. As an example, by running the
compiled version, what I see in IE is the following:

Progetto nï¾°

So, I tried to filter out those special chars by modyfing the previous
routine as follows:

##### new 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
##### new routine ENDS here

But I had no luck at all.
By doing some experiments, I then verified that by running the SOURCE
tcl code by simply doubleclicking on it the problem doesn't show up
(at least on my windows 2000 PC, English version).

I then found an answer of yours from 2002 on this newsgroup concerning
japanese characters. But that answer pointed to an old version of the
howto page for freewrap. So, maybe, that solution can be good for me
(I often use freewrap 4.4), but I have no way to check it.

Can you verify please if you see the same weird chars by running the
sample Tcl code on the sample HTML code?

Thanks in advance for any help you can give me

Stefano



Relevant Pages

  • Re: Are "include files" serach egine friendly and HTML/XHTML compliant?
    ... I am not sure but I think it has problem with ASP pages. ... done with it by removing all VBscript codes and test it again pure HTML ... Any unrendered ASP code will return an error in a validator - it must be ...
    (microsoft.public.frontpage.programming)
  • Re: Creating a DLL
    ... > The MS Common Dialog Control is an ActiveX control. ... >>I do understand the difference between ASP and ASP.NET. ... >> existing HTML pages. ...
    (microsoft.public.dotnet.languages.vb.controls)
  • Re: ASP vs ASP.NET
    ... browser can only understand HTML. ... that's all that browsers can understand. ... As far as your ASP vs. ASP.NET concerns... ... >> dynamic areas without the need to change your HTML layout techniques. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP vs ASP.NET
    ... browser can only understand HTML. ... that's all that browsers can understand. ... As far as your ASP vs. ASP.NET concerns... ... >> dynamic areas without the need to change your HTML layout techniques. ...
    (microsoft.public.inetserver.asp.general)
  • Re: ASP vs ASP.NET
    ... browser can only understand HTML. ... that's all that browsers can understand. ... As far as your ASP vs. ASP.NET concerns... ... >> dynamic areas without the need to change your HTML layout techniques. ...
    (microsoft.public.inetserver.asp.components)