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