|
|
|
@ -104,25 +104,17 @@ void TiXmlBase::ConvertUTF32ToUTF8( unsigned long input, char* output, int* leng
|
|
|
|
|
|
|
|
|
|
output += *length;
|
|
|
|
|
|
|
|
|
|
// Scary scary fall throughs.
|
|
|
|
|
switch (*length)
|
|
|
|
|
int lengthLeft = *length;
|
|
|
|
|
while (lengthLeft > 1)
|
|
|
|
|
{
|
|
|
|
|
case 4:
|
|
|
|
|
--output;
|
|
|
|
|
*output = (char)((input | BYTE_MARK) & BYTE_MASK);
|
|
|
|
|
input >>= 6;
|
|
|
|
|
case 3:
|
|
|
|
|
--output;
|
|
|
|
|
*output = (char)((input | BYTE_MARK) & BYTE_MASK);
|
|
|
|
|
input >>= 6;
|
|
|
|
|
case 2:
|
|
|
|
|
--output;
|
|
|
|
|
*output = (char)((input | BYTE_MARK) & BYTE_MASK);
|
|
|
|
|
input >>= 6;
|
|
|
|
|
case 1:
|
|
|
|
|
--lengthLeft;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
--output;
|
|
|
|
|
*output = (char)(input | FIRST_BYTE_MARK[*length]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|