]> git.pld-linux.org Git - packages/xerces-c.git/blob - xerces-c-iso88592.patch
- tabs in preamble
[packages/xerces-c.git] / xerces-c-iso88592.patch
1 diff -uNr xercesc/src/xercesc/util/Makefile.in xercesc/src/xercesc/util.new/Makefile.in
2 --- xercesc/src/xercesc/util/Makefile.in        Fri Feb  7 01:53:51 2003
3 +++ xercesc/src/xercesc/util.new/Makefile.in    Wed Apr 30 23:50:16 2003
4 @@ -506,7 +506,8 @@
5         XMLUTF8Transcoder.hpp \
6         XMLWin1252Transcoder.hpp \
7         XML256TableTranscoder.hpp \
8 -       XML88591Transcoder.hpp
9 +       XML88591Transcoder.hpp \
10 +       XML88592Transcoder.hpp
11  
12  UTIL_CPP_PRIVHEADERS =
13  
14 @@ -573,7 +574,8 @@
15         XMLUTF8Transcoder.$(TO) \
16         XMLWin1252Transcoder.$(TO) \
17         XML256TableTranscoder.$(TO) \
18 -       XML88591Transcoder.$(TO)
19 +       XML88591Transcoder.$(TO) \
20 +       XML88592Transcoder.$(TO)
21  
22  
23  all:: includes $(UTIL_CPP_OBJECTS) platforms transcoders \
24 diff -uNr xercesc/src/xercesc/util/TransService.cpp xercesc/src/xercesc/util.new/TransService.cpp
25 --- xercesc/src/xercesc/util/TransService.cpp   Fri Feb  7 01:54:05 2003
26 +++ xercesc/src/xercesc/util.new/TransService.cpp       Wed Apr 30 23:36:53 2003
27 @@ -64,6 +64,7 @@
28  #include <xercesc/util/RefHashTableOf.hpp>
29  #include <xercesc/util/RefVectorOf.hpp>
30  #include <xercesc/util/XML88591Transcoder.hpp>
31 +#include <xercesc/util/XML88592Transcoder.hpp>
32  #include <xercesc/util/XMLASCIITranscoder.hpp>
33  #include <xercesc/util/XMLChTranscoder.hpp>
34  #include <xercesc/util/XMLEBCDICTranscoder.hpp>
35 @@ -322,6 +323,22 @@
36      gMappings->put((void*)XMLUni::fgISO88591EncodingString12, new ENameMapFor<XML88591Transcoder>(XMLUni::fgISO88591EncodingString12));
37  
38      //
39 +    //  Add in our mappings for Latin2
40 +    //
41 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString));
42 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString2, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString2));
43 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString3, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString3));
44 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString4, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString4));
45 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString5, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString5));
46 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString6, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString6));
47 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString7, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString7));
48 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString8, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString8));
49 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString9, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString9));
50 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString10, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString10));
51 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString11, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString11));
52 +    gMappings->put((void*)XMLUni::fgISO88592EncodingString12, new ENameMapFor<XML88592Transcoder>(XMLUni::fgISO88592EncodingString12));
53 +
54 +    //
55      //  Add in our mappings for UTF-16 and UCS-4, little endian
56      //
57      bool swapped = false;
58 diff -uNr xercesc/src/xercesc/util/XML88592Transcoder.cpp xercesc/src/xercesc/util.new/XML88592Transcoder.cpp
59 --- xercesc/src/xercesc/util/XML88592Transcoder.cpp     Thu Jan  1 01:00:00 1970
60 +++ xercesc/src/xercesc/util.new/XML88592Transcoder.cpp Thu May  1 00:00:20 2003
61 @@ -0,0 +1,329 @@
62 +/*
63 + * The Apache Software License, Version 1.1
64 + *
65 + * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
66 + * reserved.
67 + *
68 + * Redistribution and use in source and binary forms, with or without
69 + * modification, are permitted provided that the following conditions
70 + * are met:
71 + *
72 + * 1. Redistributions of source code must retain the above copyright
73 + *    notice, this list of conditions and the following disclaimer.
74 + *
75 + * 2. Redistributions in binary form must reproduce the above copyright
76 + *    notice, this list of conditions and the following disclaimer in
77 + *    the documentation and/or other materials provided with the
78 + *    distribution.
79 + *
80 + * 3. The end-user documentation included with the redistribution,
81 + *    if any, must include the following acknowledgment:
82 + *       "This product includes software developed by the
83 + *        Apache Software Foundation (http://www.apache.org/)."
84 + *    Alternately, this acknowledgment may appear in the software itself,
85 + *    if and wherever such third-party acknowledgments normally appear.
86 + *
87 + * 4. The names "Xerces" and "Apache Software Foundation" must
88 + *    not be used to endorse or promote products derived from this
89 + *    software without prior written permission. For written
90 + *    permission, please contact apache\@apache.org.
91 + *
92 + * 5. Products derived from this software may not be called "Apache",
93 + *    nor may "Apache" appear in their name, without prior written
94 + *    permission of the Apache Software Foundation.
95 + *
96 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
97 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
98 + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
99 + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
100 + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
101 + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
102 + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
103 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
104 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
105 + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
106 + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
107 + * SUCH DAMAGE.
108 + * ====================================================================
109 + *
110 + * This software consists of voluntary contributions made by many
111 + * individuals on behalf of the Apache Software Foundation, and was
112 + * originally based on software copyright (c) 1999, International
113 + * Business Machines, Inc., http://www.ibm.com .  For more information
114 + * on the Apache Software Foundation, please see
115 + * <http://www.apache.org/>.
116 + */
117 +
118 +
119 +// ---------------------------------------------------------------------------
120 +//  Includes
121 +// ---------------------------------------------------------------------------
122 +#include <xercesc/util/TranscodingException.hpp>
123 +#include <xercesc/util/XML88592Transcoder.hpp>
124 +#include <xercesc/util/XMLString.hpp>
125 +#include <string.h>
126 +
127 +XERCES_CPP_NAMESPACE_BEGIN
128 +
129 +static const int iso8859_2_utf[] ={
130 +0x000,0x001,0x002,0x003,0x004,0x005,0x006,0x007,
131 +0x008,0x009,0x00a,0x00b,0x00c,0x00d,0x00e,0x00f,
132 +0x010,0x011,0x012,0x013,0x014,0x015,0x016,0x017,
133 +0x018,0x019,0x01a,0x01b,0x01c,0x01d,0x01e,0x01f,
134 +0x020,0x021,0x022,0x023,0x024,0x025,0x026,0x027,
135 +0x028,0x029,0x02a,0x02b,0x02c,0x02d,0x02e,0x02f,
136 +0x030,0x031,0x032,0x033,0x034,0x035,0x036,0x037,
137 +0x038,0x039,0x03a,0x03b,0x03c,0x03d,0x03e,0x03f,
138 +0x040,0x041,0x042,0x043,0x044,0x045,0x046,0x047,
139 +0x048,0x049,0x04a,0x04b,0x04c,0x04d,0x04e,0x04f,
140 +0x050,0x051,0x052,0x053,0x054,0x055,0x056,0x057,
141 +0x058,0x059,0x05a,0x05b,0x05c,0x05d,0x05e,0x05f,
142 +0x060,0x061,0x062,0x063,0x064,0x065,0x066,0x067,
143 +0x068,0x069,0x06a,0x06b,0x06c,0x06d,0x06e,0x06f,
144 +0x070,0x071,0x072,0x073,0x074,0x075,0x076,0x077,
145 +0x078,0x079,0x07a,0x07b,0x07c,0x07d,0x07e,0x07f,
146 +0x080,0x081,0x082,0x083,0x084,0x085,0x086,0x087,
147 +0x088,0x089,0x08a,0x08b,0x08c,0x08d,0x08e,0x08f,
148 +0x090,0x091,0x092,0x093,0x094,0x095,0x096,0x097,
149 +0x098,0x099,0x09a,0x09b,0x09c,0x09d,0x09e,0x09f,
150 +0x0a0,0x104,0x2d8,0x141,0x0a4,0x13d,0x15a,0x0a7,
151 +0x0a8,0x160,0x15e,0x164,0x179,0x0ad,0x17d,0x17b,
152 +0x0b0,0x105,0x2db,0x142,0x0b4,0x13e,0x15b,0x2c7,
153 +0x0b8,0x161,0x15f,0x165,0x17a,0x2dd,0x17e,0x17c,
154 +0x154,0x0c1,0x0c2,0x102,0x0c4,0x139,0x106,0x0c7,
155 +0x10c,0x0c9,0x118,0x0cb,0x11a,0x0cd,0x0ce,0x10e,
156 +0x110,0x143,0x147,0x0d3,0x0d4,0x150,0x0d6,0x0d7,
157 +0x158,0x16e,0x0da,0x170,0x0dc,0x0dd,0x162,0x0df,
158 +0x155,0x0e1,0x0e2,0x103,0x0e4,0x13a,0x107,0x0e7,
159 +0x10d,0x0e9,0x119,0x0eb,0x11b,0x0ed,0x0ee,0x10f,
160 +0x111,0x144,0x148,0x0f3,0x0f4,0x151,0x0f6,0x0f7,
161 +0x159,0x16f,0x0fa,0x171,0x0fc,0x0fd,0x163,0x2d9};
162 +
163 +static const char utf_iso8859_2[] ={
164 +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
165 +0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
166 +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
167 +0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,
168 +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,
169 +0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,
170 +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,
171 +0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
172 +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,
173 +0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,
174 +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,
175 +0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,
176 +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,
177 +0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,
178 +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,
179 +0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f,
180 +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,
181 +0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,
182 +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,
183 +0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f,
184 +0xa0,0x00,0x00,0x00,0xa4,0x00,0x00,0xa7,
185 +0xa8,0x00,0x00,0x00,0x00,0xad,0x00,0x00,
186 +0xb0,0x00,0x00,0x00,0xb4,0x00,0x00,0x00,
187 +0xb8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
188 +0x00,0xc1,0xc2,0x00,0xc4,0x00,0x00,0xc7,
189 +0x00,0xc9,0x00,0xcb,0x00,0xcd,0xce,0x00,
190 +0x00,0x00,0x00,0xd3,0xd4,0x00,0xd6,0xd7,
191 +0x00,0x00,0xda,0x00,0xdc,0xdd,0x00,0xdf,
192 +0x00,0xe1,0xe2,0x00,0xe4,0x00,0x00,0xe7,
193 +0x00,0xe9,0x00,0xeb,0x00,0xed,0xee,0x00,
194 +0x00,0x00,0x00,0xf3,0xf4,0x00,0xf6,0xf7,
195 +0x00,0x00,0xfa,0x00,0xfc,0xfd,0x00,0x00,
196 +0x00,0x00,0xc3,0xe3,0xa1,0xb1,0xc6,0xe6,
197 +0x00,0x00,0x00,0x00,0xc8,0xe8,0xcf,0xef,
198 +0xd0,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,
199 +0xca,0xea,0xcc,0xec,0x00,0x00,0x00,0x00,
200 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
201 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
202 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
203 +0x00,0xc5,0xe5,0x00,0x00,0xa5,0xb5,0x00,
204 +0x00,0xa3,0xb3,0xd1,0xf1,0x00,0x00,0xd2,
205 +0xf2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
206 +0xd5,0xf5,0x00,0x00,0xc0,0xe0,0x00,0x00,
207 +0xd8,0xf8,0xa6,0xb6,0x00,0x00,0xaa,0xba,
208 +0xa9,0xb9,0xde,0xfe,0xab,0xbb,0x00,0x00,
209 +0x00,0x00,0x00,0x00,0x00,0x00,0xd9,0xf9,
210 +0xdb,0xfb,0x00,0x00,0x00,0x00,0x00,0x00,
211 +0x00,0xac,0xbc,0xaf,0xbf,0xae,0xbe,0x00,
212 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
213 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
214 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
215 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
216 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
217 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
218 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
219 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
220 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
221 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
222 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
223 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
224 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
225 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
226 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
227 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
228 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
229 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
230 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
231 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
232 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
233 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
234 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
235 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
236 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
237 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
238 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
239 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
240 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
241 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
242 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
243 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
244 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
245 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
246 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
247 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
248 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
249 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
250 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
251 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
252 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb7,
253 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
254 +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
255 +0xa2,0xff,0x00,0xb2,0x00,0xbd};
256 +
257 +// ---------------------------------------------------------------------------
258 +//  XML88592Transcoder: Constructors and Destructor
259 +// ---------------------------------------------------------------------------
260 +XML88592Transcoder::XML88592Transcoder( const   XMLCh* const    encodingName
261 +                                        , const unsigned int    blockSize
262 +                                        , MemoryManager* const  manager) :
263 +
264 +    XMLTranscoder(encodingName, blockSize)
265 +{
266 +}
267 +
268 +
269 +XML88592Transcoder::~XML88592Transcoder()
270 +{
271 +}
272 +
273 +
274 +// ---------------------------------------------------------------------------
275 +//  XML88592Transcoder: Implementation of the transcoder API
276 +// ---------------------------------------------------------------------------
277 +unsigned int
278 +XML88592Transcoder::transcodeFrom(  const   XMLByte* const       srcData
279 +                                    , const unsigned int         srcCount
280 +                                    ,       XMLCh* const         toFill
281 +                                    , const unsigned int         maxChars
282 +                                    ,       unsigned int&        bytesEaten
283 +                                    ,       unsigned char* const charSizes)
284 +{
285 +    // If debugging, make sure that the block size is legal
286 +    #if defined(XERCES_DEBUG)
287 +    checkBlockSize(maxChars);
288 +    #endif
289 +
290 +    //
291 +    //  Calculate the max chars we can do here. Its the lesser of the
292 +    //  max output chars and the number of bytes in the source.
293 +    //
294 +    const unsigned int countToDo = srcCount < maxChars ? srcCount : maxChars;
295 +
296 +    //
297 +    //  Loop through the bytes to do and convert over each byte. Its just
298 +    //  a cast to the wide char type.
299 +    //
300 +    const XMLByte*  srcPtr = srcData;
301 +    XMLCh*          destPtr = toFill;
302 +    const XMLByte*  srcEnd = srcPtr + countToDo;
303 +    while (srcPtr < srcEnd)
304 +        *destPtr++ = XMLCh(iso8859_2_utf[*srcPtr++]);
305 +
306 +    // Set the bytes eaten, and set the char size array to the fixed size
307 +    bytesEaten = countToDo;
308 +    memset(charSizes, 1, countToDo);
309 +
310 +    // Return the chars we transcoded
311 +    return countToDo;
312 +}
313 +
314 +
315 +unsigned int
316 +XML88592Transcoder::transcodeTo(const   XMLCh* const    srcData
317 +                                , const unsigned int    srcCount
318 +                                ,       XMLByte* const  toFill
319 +                                , const unsigned int    maxBytes
320 +                                ,       unsigned int&   charsEaten
321 +                                , const UnRepOpts       options)
322 +{
323 +    // If debugging, make sure that the block size is legal
324 +    #if defined(XERCES_DEBUG)
325 +    checkBlockSize(maxBytes);
326 +    #endif
327 +
328 +    //
329 +    //  Calculate the max chars we can do here. Its the lesser of the
330 +    //  max output bytes and the number of chars in the source.
331 +    //
332 +    const unsigned int countToDo = srcCount < maxBytes ? srcCount : maxBytes;
333 +
334 +    //
335 +    //  Loop through the bytes to do and convert over each byte. Its just
336 +    //  a downcast of the wide char, checking for unrepresentable chars.
337 +    //
338 +    const XMLCh*    srcPtr  = srcData;
339 +    const XMLCh*    srcEnd  = srcPtr + countToDo;
340 +    XMLByte*        destPtr = toFill;
341 +    while (srcPtr < srcEnd)
342 +    {
343 +        // If its legal, take it and jump back to top
344 +        if (*srcPtr == 0)
345 +        {
346 +            *destPtr++ = XMLByte(*srcPtr++);
347 +            continue;
348 +        } else if ((*srcPtr<sizeof(utf_iso8859_2)) && (utf_iso8859_2[*srcPtr]!=0))
349 +       {
350 +            *destPtr++ = XMLByte(utf_iso8859_2[*srcPtr++]);
351 +            continue;
352 +       }
353 +
354 +        //
355 +        //  Its not representable so use a replacement char. According to
356 +        //  the options, either throw or use the replacement.
357 +        //
358 +        if (options == UnRep_Throw)
359 +        {
360 +            XMLCh tmpBuf[16];
361 +            XMLString::binToText((unsigned int)*srcPtr, tmpBuf, 16, 16);
362 +            ThrowXML2
363 +            (
364 +                TranscodingException
365 +                , XMLExcepts::Trans_Unrepresentable
366 +                , tmpBuf
367 +                , getEncodingName()
368 +            );
369 +        }
370 +        *destPtr++ = 0x1A;
371 +        srcPtr++;
372 +    }
373 +
374 +    // Set the chars eaten
375 +    charsEaten = countToDo;
376 +
377 +    // Return the bytes we transcoded
378 +    return countToDo;
379 +}
380 +
381 +
382 +bool XML88592Transcoder::canTranscodeTo(const unsigned int toCheck) const
383 +{
384 +    if (toCheck>=sizeof(utf_iso8859_2))return false;
385 +    if (utf_iso8859_2[toCheck]!=0)return true;
386 +    if (toCheck==0)return true;
387 +    return false;
388 +}
389 +
390 +XERCES_CPP_NAMESPACE_END
391 diff -uNr xercesc/src/xercesc/util/XML88592Transcoder.hpp xercesc/src/xercesc/util.new/XML88592Transcoder.hpp
392 --- xercesc/src/xercesc/util/XML88592Transcoder.hpp     Thu Jan  1 01:00:00 1970
393 +++ xercesc/src/xercesc/util.new/XML88592Transcoder.hpp Wed Apr 30 23:41:04 2003
394 @@ -0,0 +1,128 @@
395 +/*
396 + * The Apache Software License, Version 1.1
397 + *
398 + * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
399 + * reserved.
400 + *
401 + * Redistribution and use in source and binary forms, with or without
402 + * modification, are permitted provided that the following conditions
403 + * are met:
404 + *
405 + * 1. Redistributions of source code must retain the above copyright
406 + *    notice, this list of conditions and the following disclaimer.
407 + *
408 + * 2. Redistributions in binary form must reproduce the above copyright
409 + *    notice, this list of conditions and the following disclaimer in
410 + *    the documentation and/or other materials provided with the
411 + *    distribution.
412 + *
413 + * 3. The end-user documentation included with the redistribution,
414 + *    if any, must include the following acknowledgment:
415 + *       "This product includes software developed by the
416 + *        Apache Software Foundation (http://www.apache.org/)."
417 + *    Alternately, this acknowledgment may appear in the software itself,
418 + *    if and wherever such third-party acknowledgments normally appear.
419 + *
420 + * 4. The names "Xerces" and "Apache Software Foundation" must
421 + *    not be used to endorse or promote products derived from this
422 + *    software without prior written permission. For written
423 + *    permission, please contact apache\@apache.org.
424 + *
425 + * 5. Products derived from this software may not be called "Apache",
426 + *    nor may "Apache" appear in their name, without prior written
427 + *    permission of the Apache Software Foundation.
428 + *
429 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
430 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
431 + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
432 + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
433 + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
434 + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
435 + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
436 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
437 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
438 + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
439 + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
440 + * SUCH DAMAGE.
441 + * ====================================================================
442 + *
443 + * This software consists of voluntary contributions made by many
444 + * individuals on behalf of the Apache Software Foundation, and was
445 + * originally based on software copyright (c) 1999, International
446 + * Business Machines, Inc., http://www.ibm.com .  For more information
447 + * on the Apache Software Foundation, please see
448 + * <http://www.apache.org/>.
449 + */
450 +
451 +#ifndef XML88592TRANSCODER_HPP
452 +#define XML88592TRANSCODER_HPP
453 +
454 +#include <xercesc/util/XercesDefs.hpp>
455 +#include <xercesc/util/TransService.hpp>
456 +
457 +XERCES_CPP_NAMESPACE_BEGIN
458 +
459 +//
460 +//  This class provides an implementation of the XMLTranscoder interface
461 +//  for a simple 8859-1 transcoder. The parser does some encodings
462 +//  intrinsically without depending upon external transcoding services.
463 +//  To make everything more orthagonal, we implement these internal
464 +//  transcoders using the same transcoder abstraction as the pluggable
465 +//  transcoding services do.
466 +//
467 +class XMLUTIL_EXPORT XML88592Transcoder : public XMLTranscoder
468 +{
469 +public :
470 +    // -----------------------------------------------------------------------
471 +    //  Public constructors and destructor
472 +    // -----------------------------------------------------------------------
473 +    XML88592Transcoder
474 +    (
475 +        const   XMLCh* const    encodingName
476 +        , const unsigned int    blockSize
477 +        , MemoryManager* const  manager
478 +    );
479 +
480 +    virtual ~XML88592Transcoder();
481 +
482 +
483 +    // -----------------------------------------------------------------------
484 +    //  Implementation of the XMLTranscoder interface
485 +    // -----------------------------------------------------------------------
486 +    virtual unsigned int transcodeFrom
487 +    (
488 +        const   XMLByte* const          srcData
489 +        , const unsigned int            srcCount
490 +        ,       XMLCh* const            toFill
491 +        , const unsigned int            maxChars
492 +        ,       unsigned int&           bytesEaten
493 +        ,       unsigned char* const    charSizes
494 +    );
495 +
496 +    virtual unsigned int transcodeTo
497 +    (
498 +        const   XMLCh* const    srcData
499 +        , const unsigned int    srcCount
500 +        ,       XMLByte* const  toFill
501 +        , const unsigned int    maxBytes
502 +        ,       unsigned int&   charsEaten
503 +        , const UnRepOpts       options
504 +    );
505 +
506 +    virtual bool canTranscodeTo
507 +    (
508 +        const   unsigned int    toCheck
509 +    )   const;
510 +
511 +
512 +private :
513 +    // -----------------------------------------------------------------------
514 +    //  Unimplemented constructors and operators
515 +    // -----------------------------------------------------------------------
516 +    XML88592Transcoder(const XML88592Transcoder&);
517 +    void operator=(const XML88592Transcoder&);
518 +};
519 +
520 +XERCES_CPP_NAMESPACE_END
521 +
522 +#endif
523 diff -uNr xercesc/src/xercesc/util/XMLUni.cpp xercesc/src/xercesc/util.new/XMLUni.cpp
524 --- xercesc/src/xercesc/util/XMLUni.cpp Fri Feb  7 01:54:07 2003
525 +++ xercesc/src/xercesc/util.new/XMLUni.cpp     Wed Apr 30 23:39:59 2003
526 @@ -283,6 +283,66 @@
527      chLatin_L, chDigit_1, chNull
528  };
529  
530 +const XMLCh XMLUni::fgISO88592EncodingString[] =
531 +{
532 +    chLatin_I, chLatin_S, chLatin_O, chDigit_8, chDigit_8, chDigit_5, chDigit_9, chDash, chDigit_2, chNull
533 +};
534 +
535 +const XMLCh XMLUni::fgISO88592EncodingString2[] =
536 +{
537 +    chLatin_I, chLatin_S, chLatin_O, chDash, chDigit_8, chDigit_8, chDigit_5, chDigit_9, chDash, chDigit_2, chNull
538 +};
539 +
540 +const XMLCh XMLUni::fgISO88592EncodingString3[] =
541 +{
542 +    chLatin_I, chLatin_S, chLatin_O, chUnderscore, chDigit_8, chDigit_8, chDigit_5, chDigit_9, chDash, chDigit_2, chNull
543 +};
544 +
545 +const XMLCh XMLUni::fgISO88592EncodingString4[] =
546 +{
547 +    chLatin_I, chLatin_B, chLatin_M, chDash, chDigit_9, chDigit_1, chDigit_2, chNull
548 +};
549 +
550 +const XMLCh XMLUni::fgISO88592EncodingString5[] =
551 +{
552 +    chLatin_I, chLatin_B, chLatin_M, chDigit_9, chDigit_1, chDigit_2, chNull
553 +};
554 +
555 +const XMLCh XMLUni::fgISO88592EncodingString6[] =
556 +{
557 +    chLatin_L, chLatin_A, chLatin_T, chLatin_I, chLatin_N, chDigit_2, chNull
558 +};
559 +
560 +const XMLCh XMLUni::fgISO88592EncodingString7[] =
561 +{
562 +    chLatin_L, chLatin_A, chLatin_T, chLatin_I, chLatin_N, chDash, chDigit_2, chNull
563 +};
564 +
565 +const XMLCh XMLUni::fgISO88592EncodingString8[] =
566 +{
567 +    chLatin_L, chLatin_A, chLatin_T, chLatin_I, chLatin_N, chUnderscore, chDigit_2, chNull
568 +};
569 +
570 +const XMLCh XMLUni::fgISO88592EncodingString9[] =
571 +{
572 +    chLatin_C, chLatin_P, chDigit_9, chDigit_1, chDigit_2, chNull
573 +};
574 +
575 +const XMLCh XMLUni::fgISO88592EncodingString10[] =
576 +{
577 +    chLatin_C, chLatin_S, chLatin_I, chLatin_S, chLatin_O, chLatin_L, chLatin_A, chLatin_T, chLatin_I, chLatin_N, chDigit_2, chNull
578 +};
579 +
580 +const XMLCh XMLUni::fgISO88592EncodingString11[] =
581 +{
582 +    chLatin_I, chLatin_S, chLatin_O, chDash, chLatin_I, chLatin_R, chDash, chDigit_2, chDigit_0, chDigit_0, chNull
583 +};
584 +
585 +const XMLCh XMLUni::fgISO88592EncodingString12[] =
586 +{
587 +    chLatin_L, chDigit_2, chNull
588 +};
589 +
590  const XMLCh XMLUni::fgLocalHostString[] =
591  {
592      chLatin_l, chLatin_o, chLatin_c, chLatin_a, chLatin_l, chLatin_h, chLatin_o, chLatin_s, chLatin_t, chNull
593 diff -uNr xercesc/src/xercesc/util/XMLUni.hpp xercesc/src/xercesc/util.new/XMLUni.hpp
594 --- xercesc/src/xercesc/util/XMLUni.hpp Fri Feb  7 01:54:07 2003
595 +++ xercesc/src/xercesc/util.new/XMLUni.hpp     Wed Apr 30 23:37:19 2003
596 @@ -123,6 +123,18 @@
597      static const XMLCh fgISO88591EncodingString10[];
598      static const XMLCh fgISO88591EncodingString11[];
599      static const XMLCh fgISO88591EncodingString12[];
600 +    static const XMLCh fgISO88592EncodingString[];
601 +    static const XMLCh fgISO88592EncodingString2[];
602 +    static const XMLCh fgISO88592EncodingString3[];
603 +    static const XMLCh fgISO88592EncodingString4[];
604 +    static const XMLCh fgISO88592EncodingString5[];
605 +    static const XMLCh fgISO88592EncodingString6[];
606 +    static const XMLCh fgISO88592EncodingString7[];
607 +    static const XMLCh fgISO88592EncodingString8[];
608 +    static const XMLCh fgISO88592EncodingString9[];
609 +    static const XMLCh fgISO88592EncodingString10[];
610 +    static const XMLCh fgISO88592EncodingString11[];
611 +    static const XMLCh fgISO88592EncodingString12[];
612      static const XMLCh fgLocalHostString[];
613      static const XMLCh fgNoString[];
614      static const XMLCh fgNotationString[];
This page took 0.117313 seconds and 3 git commands to generate.