Example #1
0
//============================================================================
//		NUnicodeParser::AddBOMToUTF32 : Add a UTF32 BOM.
//----------------------------------------------------------------------------
void NUnicodeParser::AddBOMToUTF32(NData &theData, NEndianFormat theFormat) const
{   const uint8_t	*theBOM;



    // Insert the BOM
    if (theFormat == kNEndianBig)
        theBOM = theData.InsertData(0, NN_ARRAY_SIZE(kUTF32BOMBE), kUTF32BOMBE);
    else
        theBOM = theData.InsertData(0, NN_ARRAY_SIZE(kUTF32BOMLE), kUTF32BOMLE);

    NN_ASSERT(theBOM == theData.GetData());
}
Example #2
0
//============================================================================
//		NUnicodeParser::AddBOMToUTF8 : Add a UTF8 BOM.
//----------------------------------------------------------------------------
void NUnicodeParser::AddBOMToUTF8(NData &theData) const
{   const uint8_t	*theBOM;



    // Insert the BOM
    theBOM = theData.InsertData(0, NN_ARRAY_SIZE(kUTF8BOM), kUTF8BOM);
    NN_ASSERT(theBOM == theData.GetData());
}