Re: [xslt] How to send   to not UTF-8 html output ?



On Mon, Feb 02, 2004 at 11:38:41AM +0300, Vladimir B. Grebenschikov wrote:
> В пн, 02.02.2004, в 11:24, Daniel Veillard пишет:
> > On Mon, Feb 02, 2004 at 11:22:35AM +0300, Vladimir B. Grebenschikov wrote:
> > > As I just write to list I can't send nbsp sign if output is not UTF-8 
> > > (particular koi8-R in may case). Details in previous message to list.
> > > 
> > >   is translated to invalid character by xslt processer instead of
> > > valid entity. (As far as I know there is no character "nbsp" in KOI8-R
> > > encoding, but browser understand entities)
> > 
> >   Depends on the routine you use to translate to KOI8-R, probably coming
> > from iconv(), it's certainly not libxml2 nor libxslt code which does 
> > that conversion.
> 
> I do not write any special code for translation, just 
> <xsl:output method="html" encoding="KOI8-R"/>
> 
> I guess iconv does not know anything about entities so iconv can only
> report "It is not possible to translate UTF-8 character to koi8-r" and
> xslt processor should substitute &#160; entity instead.
> 
> (I have tried cp1251 encoding - same problem)

  That works for ascii:

gnome:~/tmp -> xsltproc test.xsl test.xsl
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=ascii"></head><body>
        [&#160;]
      </body>
</html>
gnome:~/tmp ->

  This means the iconv() routine think it can translate the code point
160 to the target encoding, and doesn't tell libxml2 to handle it.
If you're not happy with iconv() default behaviour, provide your own
transcoding routine and register them to libxml2. See 
   http://xmlsoft.org/encoding.html#extend

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]