Author: scantor Date: Sat Feb 28 00:42:24 2015 New Revision: 1662865 URL: http://svn.apache.org/r1662865 Log: XERCESC-2020,XERCESC-2023
Modified: xerces/c/branches/xerces-3.1/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp Modified: xerces/c/branches/xerces-3.1/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp URL: http://svn.apache.org/viewvc/xerces/c/branches/xerces-3.1/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp?rev=1662865&r1=1662864&r2=1662865&view=diff ============================================================================== --- xerces/c/branches/xerces-3.1/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp (original) +++ xerces/c/branches/xerces-3.1/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp Sat Feb 28 00:42:24 2015 @@ -39,6 +39,9 @@ #if (U_ICU_VERSION_MAJOR_NUM >= 2) #include <unicode/uclean.h> #endif +#if (U_ICU_VERSION_MAJOR_NUM >= 4) + #include <unicode/utf16.h> +#endif #if !defined(XML_OS390) && !defined(XML_AS400) && !defined(XML_HPUX) && !defined(XML_PTX) // Forward reference the symbol which points to the ICU converter data. @@ -483,7 +486,7 @@ ICUTranscoder::transcodeFrom(const XMLB UChar* startTarget; if (sizeof(XMLCh) == sizeof(UChar)) startTarget = (UChar*)toFill; - else + else startTarget = (UChar*) getMemoryManager()->allocate ( maxChars * sizeof(UChar) @@ -546,9 +549,9 @@ ICUTranscoder::transcodeFrom(const XMLB if (fFixed) { const unsigned char fillSize = (unsigned char)ucnv_getMaxCharSize(fConverter); - memset(charSizes, fillSize, maxChars); + memset(charSizes, fillSize, charsDecoded); } - else + else { // // We have to convert the series of offsets into a series of @@ -560,7 +563,7 @@ ICUTranscoder::transcodeFrom(const XMLB { charSizes[0] = (unsigned char)bytesEaten; } - else + else { // ICU does not return an extra element to allow us to figure // out the last char size, so we have to compute it from the @@ -711,7 +714,7 @@ bool ICUTranscoder::canTranscodeTo(const srcBuf[1] = UChar(toCheck & 0x3FF) + 0xDC00; srcCount++; } - else + else { srcBuf[0] = UChar(toCheck); } @@ -738,7 +741,7 @@ bool ICUTranscoder::canTranscodeTo(const , &err ); - // Set upa temp buffer to format into. Make it more than big enough + // Set up a temp buffer to format into. Make it more than big enough char tmpBuf[64]; char* startTarget = tmpBuf; const UChar* startSrc = srcBuf; @@ -920,7 +923,7 @@ char* ICULCPTranscoder::transcode(const { actualSrc = (const UChar*)toTranscode; } - else + else { // Allocate a non-const temp buf, but store it also in the actual ncActual = convertToUChar(toTranscode, 0, manager); @@ -1070,7 +1073,7 @@ XMLCh* ICULCPTranscoder::transcode(const { actualRet = (XMLCh*)targetBuf; } - else + else { actualRet = convertToXMLCh(targetBuf, manager); manager->deallocate(targetBuf);//delete [] targetBuf; @@ -1183,7 +1186,7 @@ bool ICULCPTranscoder::transcode( cons { actualSrc = (const UChar*)toTranscode; } - else + else { // Allocate a non-const temp buf, but store it also in the actual ncActual = convertToUChar(toTranscode, 0, manager); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org