Re: [protobuf] BinaryToJsonString mishandling strings containing UTF8 multibyte characters

2016-04-05 Thread Zachary Deretsky
Ron, could you post and example and some explanation on how to (de)serialize proto3 to JSON using LIBPROTOBUF_EXPORT util::Status BinaryToJsonString( TypeResolver* resolver, const string& type_url, const string& binary_input, string* json_output, const JsonOptions& options);

Re: [protobuf] Example of BinaryToJsonString in C++

2016-04-05 Thread Zachary Deretsky
Thank you, I am working on it. Zach. On Tuesday, April 5, 2016 at 11:41:48 AM UTC-7, Feng Xiao wrote: > > See examples here: > > https://github.com/google/protobuf/blob/master/src/google/protobuf/util/json_util_test.cc#L78 > > On Mon, Apr 4, 2016 at 8:45 PM, Zachary Deretsky

[protobuf] BinaryToJsonString generates invalid json for map

2016-04-12 Thread Zachary Deretsky
{"intMap":["4":500,"0":100,"1":200,"2":300,"3":400]} The above json is declared invalid by several json validators. ZZ It is generated by the jtest.proto: syntax = "proto3"; package jtest; message Jmap { map int_map = 2; } ZZZ

[protobuf] Re: BinaryToJsonString mishandling strings containing UTF8 multibyte characters

2016-04-12 Thread Zachary Deretsky
Thanks Ron, now I can generate json, but is is invalid for maps. I just posted an example with my code. Regards, Zach. On Tuesday, November 24, 2015 at 11:42:22 AM UTC-8, Ron Ben-Yosef wrote: > > Hi, > > When using *BinaryToJsonString *or *BinaryToJsonStream*, I seem to > encounter a problem

[protobuf] Does proto3 allow recursion?

2016-03-21 Thread Zachary Deretsky
Is recursion handled, for example: message Node { string value = 1; Node parent = 2; message Child { string key = 1; Node child = 2; } repeated Child children = 3; } or message Node { string value = 1;

[protobuf] Example of BinaryToJsonString in C++

2016-04-04 Thread Zachary Deretsky
Are there examples of (de)serializing to JSON in C++? What is TypeResolver and how to create it? Thanks, Zach. -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email

[protobuf] Re: Does proto3 allow recursion?

2016-04-02 Thread Zachary Deretsky
March 21, 2016 at 10:43:23 AM UTC-7, Zachary Deretsky wrote: >> >> Is recursion handled, for example: >> >> message Node { >> string value = 1; >> Node parent = 2; >> message Child { >> string key = 1; >&

Re: [protobuf] BinaryToJsonString generates invalid json for map

2016-04-13 Thread Zachary Deretsky
: > > > > On Tue, Apr 12, 2016 at 5:18 PM, Zachary Deretsky <zder...@gmail.com > > wrote: > >> {"intMap":["4":500,"0":100,"1":200,"2":300,"3":400]} >> > Which version of protobuf are you using? Clear