You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by jb...@apache.org on 2002/05/20 00:57:56 UTC
cvs commit: xml-xerces/c/src/xercesc/util/Transcoders/MacOSUnicodeConverter MacOSUnicodeConverter.cpp
jberry 02/05/19 15:57:56
Modified: c/src/xercesc/util/Transcoders/MacOSUnicodeConverter
MacOSUnicodeConverter.cpp
Log:
Fix bugs in upperCase and lowerCase for Macintosh. May fix bug #9237.
Revision Changes Path
1.3 +8 -15 xml-xerces/c/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp
Index: MacOSUnicodeConverter.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MacOSUnicodeConverter.cpp 9 Apr 2002 15:44:00 -0000 1.2
+++ MacOSUnicodeConverter.cpp 19 May 2002 22:57:56 -0000 1.3
@@ -55,7 +55,7 @@
*/
/*
- * $Id: MacOSUnicodeConverter.cpp,v 1.2 2002/04/09 15:44:00 knoaman Exp $
+ * $Id: MacOSUnicodeConverter.cpp,v 1.3 2002/05/19 22:57:56 jberry Exp $
*/
@@ -468,20 +468,16 @@
#if defined(XML_METROWERKS)
// Use this if there's a reasonable c library available.
// Metrowerks does this reasonably
- wchar_t * p = (wchar_t*) toUpperCase;
wchar_t c;
-
- while ((c = *p) != 0)
+ for (XMLCh* p = (XMLCh*)toUpperCase; ((c = *p) != 0); )
*p++ = std::towupper(c);
#elif defined(XML_MACOSX) || true
// This might work, assuming we're on an ascii compiler.
// We'll use this under ProjectBuilder for now.
// Note that this only handles the ascii portion of the
// string, leaving all other characters in original case.
- wchar_t * p = (wchar_t*)toUpperCase;
- wchar_t c;
-
- while ((c = *p) != 0)
+ XMLCh c;
+ for (XMLCh* p = (XMLCh*)toUpperCase; ((c = *p) != 0); )
{
if (c >= 'a' && c <= 'z')
c += 'A' - 'a';
@@ -492,26 +488,23 @@
#endif
}
+
void MacOSUnicodeConverter::lowerCase(XMLCh* const toLowerCase) const
{
// ��� TODO: Support CFString for this conversion
#if defined(XML_METROWERKS)
// Use this if there's a reasonable c library available.
// Metrowerks does this reasonably
- wchar_t * p = (wchar_t*) toLowerCase;
wchar_t c;
-
- while ((c = *p) != 0)
+ for (XMLCh* p = (XMLCh*)toLowerCase; ((c = *p) != 0); )
*p++ = std::towlower(c);
#elif defined(XML_MACOSX) || true
// This might work, assuming we're on an ascii compiler.
// We'll use this under ProjectBuilder for now.
// Note that this only handles the ascii portion of the
// string, leaving all other characters in original case.
- wchar_t * p = (wchar_t*)toLowerCase;
- wchar_t c;
-
- while ((c = *p) != 0)
+ XMLCh c;
+ for (XMLCh* p = (XMLCh*)toLowerCase; ((c = *p) != 0); )
{
if (c >= 'A' && c <= 'Z')
c += 'a' - 'A';
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org