xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbert...@apache.org
Subject cvs commit: xml-xalan/c/src/xalanc/XalanEXSLT XalanEXSLTString.cpp
Date Thu, 18 Sep 2003 00:35:00 GMT
dbertoni    2003/09/17 17:35:00

  Modified:    c/src/xalanc/XalanEXSLT XalanEXSLTString.cpp
  Log:
  A few tweaks to the patch.
  
  Revision  Changes    Path
  1.3       +14 -14    xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTString.cpp
  
  Index: XalanEXSLTString.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTString.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XalanEXSLTString.cpp	17 Sep 2003 21:40:00 -0000	1.2
  +++ XalanEXSLTString.cpp	18 Sep 2003 00:35:00 -0000	1.3
  @@ -331,11 +331,10 @@
   	XalanUnicode::charQuestionMark,
   	XalanUnicode::charCommercialAt,
   	XalanUnicode::charLeftSquareBracket,
  -	XalanUnicode::charRightSquareBracket,
  -	0
  +	XalanUnicode::charRightSquareBracket
   };
   const XalanDOMString::size_type 
  -XalanEXSLTFunctionEncodeURI::s_reservedCharsSize = 12;
  +XalanEXSLTFunctionEncodeURI::s_reservedCharsSize = sizeof(s_reservedChars) / sizeof(s_reservedChars[0]);;
   
   // Excluded URI characters
   const XalanDOMChar
  @@ -377,11 +376,12 @@
   
   	const XalanDOMString& theString = args[0]->str();
   	const bool            escapeReserved = args[1]->boolean();
  -	const XalanDOMString& theEncoding = 
  -		theSize == 3 ? args[2]->str() : XalanDOMString(XalanTranscodingServices::s_utf8String);
  +
  +	// We only support UTF-8, which is the default when there are only two arguments.
  +	const bool	fSupportedEncoding = theSize == 2 || XalanTranscodingServices::encodingIsUTF8(args[2]->str());
   
   	if (theString.length() == 0 ||
  -		!XalanTranscodingServices::encodingIsUTF8(theEncoding))
  +		!fSupportedEncoding)
   	{
   		return executionContext.getXObjectFactory().createStringReference(s_emptyString);
   	} 	
  @@ -491,11 +491,11 @@
   		   (theSize == 2 || args[1].null() == false));
   
       const XalanDOMString& theString = args[0]->str();
  -	const XalanDOMString& theEncoding = 
  -		theSize == 2 ? args[1]->str() : XalanDOMString(XalanTranscodingServices::s_utf8String);
   
  -	if (theString.length() == 0 ||
  -		!XalanTranscodingServices::encodingIsUTF8(theEncoding))
  +	// We only support UTF-8, which is the default when there's only one argument.
  +	const bool	fSupportedEncoding = theSize == 1 || XalanTranscodingServices::encodingIsUTF8(args[1]->str());
  +
  +	if (theString.length() == 0 || !fSupportedEncoding)
   	{
   		return executionContext.getXObjectFactory().createStringReference(s_emptyString);
   	} 
  @@ -512,9 +512,9 @@
   			theResult+= ch;
   			continue;
   		}
  -		
  +
   		// escaped character
  -		
  +
   		// count number of escaped octets
   		XalanDOMString::size_type numOctets = 0;
   		XalanDOMString::size_type j = i;
  @@ -526,7 +526,7 @@
   			++numOctets;
   			j+= s_octetSize;
   		}
  -		
  +
   		// no complete sequences found
   		if (numOctets < 1) {
   			break;
  @@ -546,7 +546,7 @@
   			XalanDOMChar byte2 = hexCharsToByte(executionContext, context, locator,
   											    theString[i+1],theString[i+2]);
   			i+=2;
  -	
  +
   			if (byte2 & 0x80 == 0) 
   			{
   				// invalid byte, bypass rest of this sequence
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org


Mime
View raw message