This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Windows Help Files: Output character not available


I was having this problem (see also http://sources.redhat.com/ml/docbook-apps/2001-q4/msg00234.html), 
where switching encodings only broke something else, so I decided to use translate() to change the pesky characters in the .hhc file (mdashes and ndashes in this case) with a translate(). The only place the you need to remove the characters is in the .hhc file.

In htmlhelp-common.xsl, change several instances of this:

<xsl:text disable-output-escaping="yes">&lt;LI&gt; &lt;OBJECT type="text/sitemap"&gt;
      &lt;param name="Name" value="</xsl:text>
          <xsl:value-of select="normalize-space($title)"/>

To something like this, adding/changing the translate()s so they take care of the characters that are causing problems in the encoding you want to use:

<xsl:text disable-output-escaping="yes">&lt;LI&gt; &lt;OBJECT type="text/sitemap"&gt;
      &lt;param name="Name" value="</xsl:text>
<xsl:value-of select="translate(translate(normalize-space($title),'&#8212;','-'),'&#8211;','-')"/>
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you want to more than a simple character substitution/removal (for example, if you want to replace the TM symbol with the letters TM), then you'd have to call string.subst instead: http://docbook.sourceforge.net/release/xsl/current/doc/lib/lib.html#string.subst

David

> -----Original Message-----
> From: Stephan Wiesner [mailto:stephan@stephan-wiesner.de]
> Sent: Tuesday, January 07, 2003 8:58 AM
> Cc: docbook-apps@lists.oasis-open.org
> Subject: Re: DOCBOOK-APPS: Windows Help Files: Output character not
> available
> 
> 
> Thanks Jirka,
> it works when I use
> <xsl:param name="htmlhelp.encoding">ISO-8859-1</xsl:param>
> and &#174; (The R in a circle), not with &#8482; (the TM 
> sign), though.
> I can live with that, though.
> 
> Stephan
> 
> Jirka Kosek wrote:
> > Stephan Wiesner wrote:
> > 
> > 
> >>The encoding for my document is ISO-8859-1 and if I remove 
> the trademark
> >>sign it works. Anybody knows how to solve this?
> > 
> > 
> > Set parameter htmlhelp.encoding to the name of encoding 
> which contains
> > TM chatacter. I think that following should work:
> > 
> > <xsl:param name="htmlhelp.encoding">windows-1252</xsl:param>
> > 
> 
> 
> 
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]