kikinteractive/protostuff — pull request #1 by mfycheng (2014-10-28 22:50:16+00:00)
Title: Java 8 Encoding Fix

Motivation
---
Java 8's built in String class no longer accepts 3-byte surrogates / 6-byte surrogate pairs. This causes issues when UTF characters, such as emoji's, are present in a string. Since Protostuff encodes using 3-byte surrogates / 6-byte surrogate pairs, deserialization using Java's String class results in a corrupted String.

Changes
---
* Support 3-byte surrogates / 6-byte surrogate pairs in Java 8, which allows for communication with older version of protostuff.
* Encode surrogate pairs using Standard UTF-8, instead of 6-byte surrogate pairs to avoid corruption for decoders without 3-byte surrogate / 6-byte surrogate pair support.

Effects
---
* This change should be fully compatible with previous versions of Protostuff, as well as Protobuff's implementations.
* The serialized output should be more in line with what standardized UTF-8 decoders expect.
* `DataInputStream` will **not** be able to reliably decode Strings, as they have no support for 4-byte encoded characters.