Forum OpenACS Q&A: Translation of quote characters stops

Collapse
Posted by Bob OConnor on

We had some plain html content that had “left and right” double quotes and ‘left and right’ single quotes that were translated automatically to " and ' respectively. This was when we were using aolserver 3.0 and nsd76.

Now we are using aolserver 3.2 ad12+ with nsd8x and the pages show up with big  (A with hat) for each of these characters.

Is there someplace to configure the translations to the " and ' or better, the &#nnn equivelent?

-Bob

Collapse
Posted by Bob OConnor on

Ok, seeing no answers I'll offer my discoveries and solution.

It turns out that .html pages are parsed differently than .adp pages are parsed
AND
the very easy solution is to just rename all .html pages with these high order characters to .adp and they are interperted correctly.

OTOH, maybe someone knows a simple way to make aolserver interpert .html just like .adp.

I do remember that it may take the server more time to parse .adp pages.

* Is this true if they are identical files?

-Bob

Collapse
Posted by Bob OConnor on

I may be onto something here in the nsxxx.tcl file

# Directory listings -- use an ADP or a Tcl proc to generate them.
#
  #ns_param   directoryadp    $pageroot/dirlist.adp ;# Choose one or the other
  ns_param   directoryproc    _ns_dirlist           ;#  ...but not both!
  ns_param   directorylisting  fancy                ;# Can be simple or fancy
#
# ADP (AOLserver Dynamic Page) configuration
#
ns_section "ns/server/${server}/adp"
  ns_param   map           "/*.adp"  ;# Extensions to parse as ADP's
  ns_param   map          "/*.html" ;# Any extension can be mapped
  ns_param   enableexpire  false     ;# Set "Expires: now" on all ADP's
  ns_param   enabledebug   false     ;# Allow Tclpro debugging with "?debug"

# ADP special pages
  #ns_param   errorpage      ${pageroot}/errorpage.adp ;# Pretty-print ADP scripting errors

#
# ADP custom parsers -- see adp.c
#
ns_section "ns/server/${server}/adp/parsers"
        ns_param   fancy            ".adp"

I uncommented the
ns_param map "/*.html"
expecting html to be interperted as adp but it makes no difference.

-Bob

Collapse
Posted by David Walker on
Look at the tcl page support section of ad-aolserver-3.tcl.preload.

You can probably add a file into your tcl folder with
 ns_register_proc GET /*.html ns_sourceproc
 ns_register_proc POST /*.html ns_sourceproc
 ns_register_proc HEAD /*.html ns_sourceproc
in it.
Collapse
Posted by Bob OConnor on
<p>Patrick offered me a great solution to make HTML pages read like ADP pages:

<p>Change the code in /tcl/ad-html.tcl and in proc_doc ad_serve_html_page by replacing this one line:

<pre>OLD:
    set stream [open $full_filename r]
    set whole_page [read $stream]

NEW:
    set stream [open $full_filename r]
    set whole_page [ns_adp_parse -file $full_filename]
</pre>

<p>I'm still not sure how much extra processing goes on
using adp pages over html...

<p>-Bob

Collapse
Posted by David Walker on
I don't know what I was thinking.  What I told you to do would have
made html pages act like tcl pages.