2008-02-21

I am writing a book about Java 6 programming, the basics. My intention is to use it at my work as a teacher in high-school. First I used LaTeX for typesetting the book, LaTeX is nice I think. But today I suddenly changed my mind and converted it to DocBook/XML . Don't ask me why - I just thought it was a good idea.

So there I was, five chapters written and ready for being sent to my friend for proof-reading. Typed the command:

$ jw -f docbook -b pdf dtr1207.xml

I got many errors like this:
openjade:/home/jonas/dtr1207-java/dtr1207.xml:303:9:E: non SGML character number 150

It seemed to be the char "Ö" that were the problem. I changed it to "ö" and the pdf were built fine. But I couldn't change every Ö in my text to ö just because of a stupid buildprocess. Google wasn't very helpful either. Then suddenly I read about SP_ENCODING.

$ SP_ENCODING="UTF-8" jw -f docbook -b pdf dtr1207.xml


SP_ENCODING can be set to XML or UTF-8. If it is set to XML it will read the XML-tag in document and use that encoding, I choosed to force it to be UTF-8.

Inga kommentarer: