public void testLegacySurrogatePairs() throws Exception
    {
        LinkedBuffer lb = new LinkedBuffer(256);
        WriteSession session = new WriteSession(lb);
        StringSerializer.writeUTF8(surrogatePairs, session, lb);

        byte[] buffered = session.toByteArray();

        // By default, STRING.deser should not use the custom
        // decoder (specifically, should not check the decoded
        // string for REPLACE characters). This means that legacy
        // encoded Strings with surrogate pairs will result in
        // malformed Strings
        assertNotSame(surrogatePairs, STRING.deser(legacySurrogatePairSerialized));

        // New Strings, however, should be deserialized fine
        assertEquals(surrogatePairs, STRING.deser(buffered));
    }
Tests for UTF-8 Encoding

@author David Yu
@created Jul 6, 2010
protostuff-api/src/test/java/io/protostuff/StringSerializerTest.java