The Java protocol buffer API encodes strings as UTF-8. Since C++ has
no unicode support, what you get on the other end is the raw UTF-8
encoded data. You'll need to use some Unicode API to process it in
whatever way your application requires. I suggest ICU:
Hope this helps,
Evan
> if on the stream writer, I add something like:> writer.write(new String(msg.getBytes(), "UTF8").getBytes()) instead ofStill not sure on the above though.
> simply writer.write(msg.getBytes()), I see the characters as expected
> on the C++ client. However this I believe messes up with the protobuf
> headers, so on C++ I receive only a partial file upto the entry that
> contains one such character.
Yes. In this case, you need to use the protocol buffer "bytes" type
instead of the protocol buffer "string" type, since you want to
exchange ISO-8859-1 bytes from program to program (bytes), not unicode
text (string).
On the Java side, you'll need to use
ByteString.copyFrom(myStringobject, "ISO-8859-1") to make a ByteString
out of a Java string.