I suspect that protoc --decode_raw is interpreting that string field as a
submessage field. The protobuf wire format
<https://developers.google.com/protocol-buffers/docs/encoding> treats
string, bytes, and submessage fields the same way, in that it marks them
with the length-delimited wire type and prefixes them with their length.
Without knowing the schema, protoc --decode_raw can only guess whether it's
a string or a message, and so in this case it's guessing that it's a
message. As a result, it thinks the 'M' byte (0x4D) is a tag associated
with field number 9.

On Sun, Oct 14, 2018 at 11:50 PM dim roz <[email protected]> wrote:

> Hello
>
> When trying to decode_raw some binary data with protoc util im getting
> this:
> ...
>     3 {
>       1: "PIRANHA"
>       2: 2
>       3: ""
>     }
>     3 {
>       1 {
> *        9: 0x75717261*
> *        12: 0x30317373*
>       }
>       2: 12
>       3: ""
>     }
> ...
>
> 3:1 field is string, but in some cases its encoded with set of numbers,
>
> 0x61 0x72 0x71 0x75   0x73 0x73 0x31 0x30
>
> gives: "arquss10" string and its close to original : "*M*arquss10"
>
> problem is i have no idea where to get 'M' 0x4D to decode original string.
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to