You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by tn...@apache.org on 2003/01/10 19:43:51 UTC
cvs commit: xml-xerces/c/src/xercesc/util/Transcoders/Iconv390 Iconv390TransService.cpp
tng 2003/01/10 10:43:51
Modified: c/src/xercesc/util/Transcoders/Iconv390
Iconv390TransService.cpp
Log:
[Bug 13909] Use of non standard mbstowcs feature.
Revision Changes Path
1.5 +8 -23 xml-xerces/c/src/xercesc/util/Transcoders/Iconv390/Iconv390TransService.cpp
Index: Iconv390TransService.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/Iconv390/Iconv390TransService.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Iconv390TransService.cpp 6 Jan 2003 21:46:08 -0000 1.4
+++ Iconv390TransService.cpp 10 Jan 2003 18:43:51 -0000 1.5
@@ -350,33 +350,18 @@
// ---------------------------------------------------------------------------
unsigned int Iconv390LCPTranscoder::calcRequiredSize(const char* const srcText)
{
- unsigned int retVal;
-
if (!srcText)
return 0;
-#ifdef OS390BATCH
- //
- // Cannot use mbstowcs in a non-POSIX environment(???).
- //
- if (!__isPosixOn()) {
- const unsigned charLen = mblen(srcText, MB_CUR_MAX);
- if (charLen == -1)
- return 0;
- else {
- if (charLen != 0)
- retVal = strlen(srcText)/charLen;
- else
- retVal = charLen;
- }
- }
- else
-#endif
- retVal = ::mbstowcs(NULL, srcText, 0);
+ unsigned charLen = ::mblen(srcText, MB_CUR_MAX);
+ if (charLen == -1)
+ return 0;
+ else if (charLen != 0)
+ charLen = strlen(srcText)/charLen;
- if (retVal == -1)
+ if (charLen == -1)
return 0;
- return retVal;
+ return charLen;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org