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 whenever there's a message containing a string 
> containing multibyte characters.
> After some debugging, it seems the place where things start to go wrong is 
> in *ReadCodePoint* (in when the first byte of the 
> multibyte character is being read from the string (as char) and assigned 
> into a variable of type uint32. This casting directly from a signed 1-byte 
> value to an unsigned 4-byte value seems to produce values that are 
> different than intended and different than expected a little later on by 
> some *if-else* statements trying to look at that value to determine the 
> correct length of the multibyte character. From there things go wrong and 
> the string isn't serialized and just gets dropped...
> For now as a temporary solution I added a cast of the value returned by 
> StringPiece's *operator[ ]* to uint8 before the assignment into uint32, 
> but any advice or a more permanent solution will be appreciated.
> Thanks,
> Ron

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 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to