Hi,

> > a) both variants are correct (so, ProtoBuf.jl shall be corrected)
> >
> > Is there any recommendation on how these repeated arrays shall be encoded?
> > I tried to find the information at Google ProtoBuf website, but I have
> > found only a very basic examples, not covering this in particular.
> >
> Repeated fields can be encoded in two forms: the regular form and the
> packed form:
> https://developers.google.com/protocol-buffers/docs/encoding#packed
> 
> Both are valid and a parser is expected to be able to parse both.

And as for why nanopb is the only one encoding it differently, it is 
because I always encode as packed. (Listed under limitations here
http://koti.kapsi.fi/jpa/nanopb/docs/index.html )

This design choice was made because parsers should be able to decode 
both types, and packed format is more efficient for arrays longer than 
1. So from code size point of view it didn't make sense to implement 
both formats.

It may be that ProtoBuf.jl has just overlooked this point that decoders 
should accept both formats. As a workaround, one can try adding 
[packed=true] to .proto.

--
Petteri

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

Reply via email to