[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook] invalid characters for ISO-8859-1 response
I would rather not have special characters in my source -- opening the file with vi renders strange things. If it has to be a space, then it should be a literal space (in my opinion) -- why a reference to a utf-8 character that is then converted on the fly w/ xsl to the rendered space? ASCII got me the html entities which is better than "|@?". My server serves it as ISO-8895-1, so UTF-8 isn't an accurate meta tag. I'm somewhat confused...because when I hand-code html, I never get these wierd "A-hat" characters -- seems to be something specific to xslt, because I also saw this behavior last time I used xslt (about 2 years ago). The browser behaviors I've seen give the response header credibility over the meta tag. On 10/31/07, Bob Stayton <bobs@sagehill.net> wrote: > Yes, the default output encoding for XHTML is UTF-8 (see the xsl:output > element in xhtml/docbook.xsl). All modern browsers handle UTF-8 if they > interpret the file correctly. The problem is when a http server indicates > that the document is some other encoding, then that confuses some browers. > Try browsing the files locally and you'll see that they work. > > Bob Stayton > Sagehill Enterprises > DocBook Consulting > bobs@sagehill.net > > > ----- Original Message ----- > From: "Anthony Ettinger" <anthony@chovy.com> > To: "Bob Stayton" <bobs@sagehill.net> > Cc: <docbook@lists.oasis-open.org> > Sent: Tuesday, October 30, 2007 7:47 PM > Subject: Re: [docbook] invalid characters for ISO-8859-1 response > > > > Ok, if that's the case, then the assumption is that xhtml outputted is > > UTF-8 encoded? Seems odd that would be a requirement to be viewed > > properly in a browser. > > > > The   gets converted into its character at transformation time, > > right? > > > > > > > > > > On 10/30/07, Bob Stayton <bobs@sagehill.net> wrote: > >> Hi Anthony, > >> I think if you look again, you will see that the nobreak spaces are not > >> replacing spaces within your titles, but appear only before and after > >> the > >> chapter number. The intention was to keep the chapter label, number, > >> and > >> first word of the chapter title together. > >> > >> These non-breaking spaces are defined in the gentext files for each > >> language, such as common/en.xml. These files are used for both the HTML > >> and FO outputs. You can customize them to use plain spaces if you like. > >> You will see lines like this, where   should be replaced with a > >> regular space. > >> > >> <l:template name="chapter" text="Chapter %n. %t"/> > >> > >> See this reference for information on customizing the gentext strings > >> > >> http://www.sagehill.net/docbookxsl/CustomGentext.html > >> > >> Bob Stayton > >> Sagehill Enterprises > >> DocBook Consulting > >> bobs@sagehill.net > >> > >> > >> ----- Original Message ----- > >> From: "Anthony Ettinger" <anthony@chovy.com> > >> To: "Bob Stayton" <bobs@sagehill.net> > >> Cc: <docbook@lists.oasis-open.org> > >> Sent: Tuesday, October 30, 2007 5:05 PM > >> Subject: Re: [docbook] invalid characters for ISO-8859-1 response > >> > >> > >> > That answers the question about how to change the output > >> > encoding...but why is it inserting a non-breaking space > >> > character...vs. just a regular old space (as is the input). > >> > > >> > Why does "Some Title" become "Some<nobr-space-char>Title"?? > >> > > >> > It should just remain. > >> > > >> > I think i've traced it down to normalize-space(); but not sure: > >> > > >> > ./common/gentext.xsl > >> > > >> > <xsl:template match="*" mode="object.title.markup.textonly"> > >> > <xsl:variable name="title"> > >> > <xsl:apply-templates select="." mode="object.title.markup"/> > >> > </xsl:variable> > >> > <xsl:value-of select="normalize-space($title)"/> > >> > </xsl:template> > >> > > >> > > >> > > >> > On 10/30/07, Bob Stayton <bobs@sagehill.net> wrote: > >> >> Hi Anthony, > >> >> The special characters you are seeing are non-breaking spaces. > >> >> > >> >> As you discovered changing the input encoding has no effect on the > >> >> output > >> >> encoding, since they are independent of each other. > >> >> > >> >> Are you chunking your HTML output? If so, then changing the output > >> >> encoding is easy. See this reference: > >> >> > >> >> http://www.sagehill.net/docbookxsl/Chunking.html#ChunkEncoding > >> >> > >> >> If you are using single-file HTML output, then you have to set the > >> >> encoding > >> >> attribute in an xsl:output element in your stylesheet customization > >> >> layer > >> >> to change the output encoding. > >> >> > >> >> Bob Stayton > >> >> Sagehill Enterprises > >> >> DocBook Consulting > >> >> bobs@sagehill.net > >> >> > >> >> > >> >> ----- Original Message ----- > >> >> From: "Anthony Ettinger" <anthony@chovy.com> > >> >> To: <docbook@lists.oasis-open.org> > >> >> Sent: Tuesday, October 30, 2007 12:49 PM > >> >> Subject: [docbook] invalid characters for ISO-8859-1 response > >> >> > >> >> > >> >> > If I do the docbook -> xhtml transformation (v 4.4) I get invalid > >> >> > characters for the chapter numbers in the output. If I change the > >> >> > character encoding in the browser view from ISO-8859-1 to UTF-8 > >> >> > they > >> >> > look ok. > >> >> > > >> >> > I have to use ISO-8859-1 for now, because that's what the server > >> >> > sends > >> >> > the response as...also, I'm unclear why there are special > >> >> > characters > >> >> > at all in the output just to display chapter numbers: > >> >> > > >> >> > output: > >> >> > <h2 class="title"><a id="reports"></a>Chapter?| 3.?| Reports</h2> > >> >> > > >> >> > Note the "Chapter?|3.?|Reports" (this is from vim when I view the > >> >> > source directly, I get the "A-hat" character when viewing source in > >> >> > the browser. > >> >> > > >> >> > How should I fix this problem, all I really need is a space..no > >> >> > special character to represent "Chapter 3. Reports" should be > >> >> > needed > >> >> > here. > >> >> > > >> >> > I tried changing the xml charset in the xml declaration, but that > >> >> > didn't do anything. > >> >> > > >> >> > -- > >> >> > Anthony Ettinger > >> >> > Ph: 408-656-2473 > >> >> > var (bonita, farley) = new Dog; > >> >> > farley.barks("very loud"); > >> >> > bonita.barks("at strangers"); > >> >> > > >> >> > http://chovy.dyndns.org/resume/ > >> >> > http://utuxia.com/consulting > >> >> > > >> >> > --------------------------------------------------------------------- > >> >> > To unsubscribe, e-mail: docbook-unsubscribe@lists.oasis-open.org > >> >> > For additional commands, e-mail: docbook-help@lists.oasis-open.org > >> >> > > >> >> > > >> >> > > >> >> > >> >> > >> >> > >> > > >> > > >> > -- > >> > Anthony Ettinger > >> > Ph: 408-656-2473 > >> > var (bonita, farley) = new Dog; > >> > farley.barks("very loud"); > >> > bonita.barks("at strangers"); > >> > > >> > http://chovy.dyndns.org/resume/ > >> > http://utuxia.com/consulting > >> > > >> > > >> > >> > >> > > > > > > -- > > Anthony Ettinger > > Ph: 408-656-2473 > > var (bonita, farley) = new Dog; > > farley.barks("very loud"); > > bonita.barks("at strangers"); > > > > http://chovy.dyndns.org/resume/ > > http://utuxia.com/consulting > > > > > > > -- Anthony Ettinger Ph: 408-656-2473 var (bonita, farley) = new Dog; farley.barks("very loud"); bonita.barks("at strangers"); http://chovy.dyndns.org/resume/ http://utuxia.com/consulting
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]