Reputation: 567
I need to pass Protocol Buffers structures as ASCII strings (actually UTF8 strings, but ASCII would also do). Is there any out of the box solution in C++ ?
Upvotes: 1
Views: 2243
Reputation: 52083
If you want to be lazy you could always base64 the binary output.
Upvotes: 3
Reputation: 1500815
You should be able to use the TextFormat
class with its Parse
and Print
functions. I can't remember offhand how that treats non-ASCII string fields, so you should check that, but it's the general support for text in Protocol Buffers. Various other platforms support the same format, so it's still portable.
Upvotes: 3