001: package net.sf.saxon.charcode;
002:
003: /**
004: This package defines pluggable character set CP852
005: */
006:
007: public class CP852CharacterSet implements PluggableCharacterSet {
008:
009: public static CP852CharacterSet theInstance = null;
010:
011: private CP852CharacterSet() {
012: }
013:
014: public static CP852CharacterSet getInstance() {
015: if (theInstance == null) {
016: init();
017: theInstance = new CP852CharacterSet();
018: }
019: return theInstance;
020: }
021:
022: private static boolean c[] = null;
023:
024: private static void init() {
025: c = new boolean[400];
026: for (int i = 0; i < 127; i++) {
027: c[i] = true;
028: }
029: for (int i = 127; i < 400; i++) {
030: c[i] = false;
031: }
032:
033: c[167] = true;
034: c[171] = true;
035: c[172] = true;
036: c[187] = true;
037: c[193] = true;
038: c[194] = true;
039: c[196] = true;
040: c[199] = true;
041: c[201] = true;
042: c[203] = true;
043: c[205] = true;
044: c[206] = true;
045: c[211] = true;
046: c[212] = true;
047: c[214] = true;
048: c[218] = true;
049: c[220] = true;
050: c[221] = true;
051: c[223] = true;
052: c[225] = true;
053: c[226] = true;
054: c[228] = true;
055: c[231] = true;
056: c[233] = true;
057: c[235] = true;
058: c[237] = true;
059: c[238] = true;
060: c[243] = true;
061: c[244] = true;
062: c[246] = true;
063: c[250] = true;
064: c[252] = true;
065: c[253] = true;
066: c[258] = true;
067: c[259] = true;
068: c[260] = true;
069: c[261] = true;
070: c[262] = true;
071: c[263] = true;
072: c[268] = true;
073: c[269] = true;
074: c[270] = true;
075: c[271] = true;
076: c[272] = true;
077: c[273] = true;
078: c[280] = true;
079: c[281] = true;
080: c[282] = true;
081: c[283] = true;
082: c[313] = true;
083: c[314] = true;
084: c[317] = true;
085: c[318] = true;
086: c[321] = true;
087: c[322] = true;
088: c[323] = true;
089: c[324] = true;
090: c[327] = true;
091: c[328] = true;
092: c[336] = true;
093: c[337] = true;
094: c[340] = true;
095: c[341] = true;
096: c[344] = true;
097: c[345] = true;
098: c[346] = true;
099: c[347] = true;
100: c[350] = true;
101: c[351] = true;
102: c[352] = true;
103: c[353] = true;
104: c[355] = true;
105: c[356] = true;
106: c[357] = true;
107: c[366] = true;
108: c[367] = true;
109: c[368] = true;
110: c[369] = true;
111: c[377] = true;
112: c[378] = true;
113: c[379] = true;
114: c[380] = true;
115: c[381] = true;
116: c[382] = true;
117: }
118:
119: public final boolean inCharset(int ch) {
120: return ch < 400 && c[ch];
121: }
122:
123: public final String getEncodingName() {
124: return "cp852";
125: }
126: }
127:
128: /*
129: (C) Z. Wagner -- Ice Bear Soft, 11 Oct 2001
130: http://icebearsoft.euweb.cz
131:
132: This package is free software. Its use and distribution should follow
133: the Library General Public Licence (see http://www.gnu.org). Since this licence
134: is void in the Czech Republic, the users may opt to use a modified version
135: available from http://www.zastudena.cz
136:
137: The character mapping was obtained by conversion a character table of all non-US characters from
138: CP852 into UNICODE entities using a simple stylesheet and saxon with the following attribute in
139: xsl:output
140:
141: saxon:character-representation="dec;dec"
142:
143: The class was tested by reverse conversion of the generated table to native representation as well
144: as by transformation of several texts which use Czech and Slovak accented characters.
145: */
|