From d13192eb5f36fe4169e51e679eb247143ff28be1 Mon Sep 17 00:00:00 2001 From: Jirka Kosek Date: Wed, 17 Nov 2004 12:29:11 +0000 Subject: [PATCH] Added support for windows-1252 output encoding. This is handy for generating HTML Help for Western European Languages. Now you can use windows-1252 when specifying htmlhelp.encoding or chunker.output.encoding. But please note that in order to use this encoding name, you must set the following option to your JVM: -Dencoding.windows-1252=com.nwalsh.saxon.Windows1252 --- .../com/nwalsh/saxon/Windows1252.java | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 xsl/extensions/saxon643/com/nwalsh/saxon/Windows1252.java diff --git a/xsl/extensions/saxon643/com/nwalsh/saxon/Windows1252.java b/xsl/extensions/saxon643/com/nwalsh/saxon/Windows1252.java new file mode 100644 index 000000000..fb1ed4526 --- /dev/null +++ b/xsl/extensions/saxon643/com/nwalsh/saxon/Windows1252.java @@ -0,0 +1,73 @@ +/* This file was kindly provided by Sectra AB, Sweden to DocBook community */ +package com.nwalsh.saxon; + +import com.icl.saxon.charcode.PluggableCharacterSet; + +/** + * + * File: Windows1252CharacterSet.java + * Created: May 26 2004 + * Author: Pontus Haglund + * Project: Venus + * + * + * This class extends Saxon 6.5.3 with the windows-1252 character set + * + * 1. Make sure saxon.jar is in your CLASSPATH + * 2. Compile file javac Windows1252CharacterSet.java + * 3. Create a directory structure $(PATH)/com/icl/saxon/charcode + * and make sure $(PATH) is in your CLASSPATH + * 4. Put Windows1252CharacterSet.class into $(PATH)/com/icl/saxon/charcode + * 5. Add the following 4 lines to your customization layer + * + * com.icl.saxon.charcode.Windows1252CharacterSet + * com.icl.saxon.charcode.Windows1252CharacterSet + * com.icl.saxon.charcode.Windows1252CharacterSet + * + * + */ + + + +public class Windows1252 implements PluggableCharacterSet { + + public final boolean inCharset(int c) { + + return (c >= 0x00 && c <= 0x7F) || + (c >= 0xA0 && c <= 0xFF) || + (c == 0x20AC) || + (c == 0x201A) || + (c == 0x0192) || + (c == 0x201E) || + (c == 0x2026) || + (c == 0x2020) || + (c == 0x2021) || + (c == 0x02C6) || + (c == 0x2030) || + (c == 0x0160) || + (c == 0x2039) || + (c == 0x0152) || + (c == 0x017D) || + (c == 0x2018) || + (c == 0x2019) || + (c == 0x201C) || + (c == 0x201D) || + (c == 0x2022) || + (c == 0x2013) || + (c == 0x2014) || + (c == 0x02DC) || + (c == 0x2122) || + (c == 0x0161) || + (c == 0x203A) || + (c == 0x0153) || + (c == 0x017E) || + (c == 0x0178); + + + } + + public String getEncodingName() { + return "WINDOWS-1252"; + } + +} -- 2.40.0