2025.6.1
This commit is contained in:
@@ -107,19 +107,26 @@ void _TiXmlBase::EncodeString( const TIXML_STRING& str, TIXML_STRING* outString
|
||||
}
|
||||
else if ( c < 32 )
|
||||
{
|
||||
// Easy pass at non-alpha/numeric/symbol
|
||||
// Below 32 is symbolic.
|
||||
char buf[ 32 ];
|
||||
// NOTE: ASCII characters < 32 are control characters.
|
||||
// only control characters 0x09, 0x0A and 0x0D are allowed in XML 1.0, others need to be stored in XML 1.1
|
||||
// Since XML 1.1 is not supported properly by most applications (including web browsers), we don't want to store the "XML 1.1"-specific control characters.
|
||||
// For more information, see https://en.wikipedia.org/wiki/Valid_characters_in_XML
|
||||
if(c == 0x09 || c == 0x0D || c == 0x0A)
|
||||
{
|
||||
// Easy pass at non-alpha/numeric/symbol.
|
||||
// Below 32 is symbolic.
|
||||
char buf[ 32 ];
|
||||
|
||||
#if defined(TIXML_SNPRINTF)
|
||||
TIXML_SNPRINTF( buf, sizeof(buf), "&#x%02X;", (unsigned) ( c & 0xff ) );
|
||||
#else
|
||||
sprintf( buf, "&#x%02X;", (unsigned) ( c & 0xff ) );
|
||||
#endif
|
||||
#if defined(TIXML_SNPRINTF)
|
||||
TIXML_SNPRINTF( buf, sizeof(buf), "&#x%02X;", (unsigned) ( c & 0xff ) );
|
||||
#else
|
||||
sprintf( buf, "&#x%02X;", (unsigned) ( c & 0xff ) );
|
||||
#endif
|
||||
|
||||
//*ME: warning C4267: convert 'size_t' to 'int'
|
||||
//*ME: Int-Cast to make compiler happy ...
|
||||
outString->append( buf, (int)strlen( buf ) );
|
||||
//*ME: warning C4267: convert 'size_t' to 'int'
|
||||
//*ME: Int-Cast to make compiler happy ...
|
||||
outString->append( buf, (int)strlen( buf ) );
|
||||
}
|
||||
++i;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user