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...@locus.apache.org on 2000/10/10 20:44:02 UTC

cvs commit: xml-xerces/c/src/util/Platforms/MacOS MacOSPlatformUtils.cpp

jberry      00/10/10 11:44:00

  Modified:    c/src/util/Platforms/MacOS MacOSPlatformUtils.cpp
  Log:
  Fix a bug in returned length of transcoded string.
  Add a few comments.
  
  Revision  Changes    Path
  1.16      +18 -2     xml-xerces/c/src/util/Platforms/MacOS/MacOSPlatformUtils.cpp
  
  Index: MacOSPlatformUtils.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/util/Platforms/MacOS/MacOSPlatformUtils.cpp,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- MacOSPlatformUtils.cpp	2000/10/09 18:46:23	1.15
  +++ MacOSPlatformUtils.cpp	2000/10/10 18:43:57	1.16
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: MacOSPlatformUtils.cpp,v 1.15 2000/10/09 18:46:23 jberry Exp $
  + * $Id: MacOSPlatformUtils.cpp,v 1.16 2000/10/10 18:43:57 jberry Exp $
    */
   
   
  @@ -1531,6 +1531,13 @@
   {
   	std::size_t result = 0;
   	
  +    //	This special casing is needed because the Text Encoding Converter
  +    //	fails on Mac OS X public beta if the HIToolbox has not been
  +    //	dragged in. This should be fixed before final. But for now,
  +    //	we use CFString instead to do the transcoding on X. An alternative
  +    //	temporary fix would be to explicitly drag in HIToolbox by
  +    //	doing something like: if (KeyScript != KeyScript) KeyScript(0);
  +    //		-jdb
   	if (gIsClassic || !TARGET_API_MAC_CARBON)
   	{
   		//	Use the text encoding converter to perform the format conversion.
  @@ -1584,6 +1591,7 @@
   #endif
   	}
   	
  +    //	Return number of chas in dst
   	return result;
   }
   
  @@ -1593,6 +1601,13 @@
   {
   	std::size_t result = 0;
   	
  +    //	This special casing is needed because the Text Encoding Converter
  +    //	fails on Mac OS X public beta if the HIToolbox has not been
  +    //	dragged in. This should be fixed before final. But for now,
  +    //	we use CFString instead to do the transcoding on X. An alternative
  +    //	temporary fix would be to explicitly drag in HIToolbox by
  +    //	doing something like: if (KeyScript != KeyScript) KeyScript(0);
  +    //		-jdb
   	if (gIsClassic || !TARGET_API_MAC_CARBON)
   	{
   		//	Use the text encoding converter to perform the format conversion.
  @@ -1627,7 +1642,7 @@
   						
   		TECDisposeConverter(tec);
   		
  -		result = bytesProduced;
  +		result = bytesProduced / sizeof(UniChar);
   	}
   	else
   	{
  @@ -1650,5 +1665,6 @@
   #endif
   	}
   	
  +    //	Return number of unicode characters in dst
   	return result;
   }