Packed fields and bytes fields use the same representation in the encoded
wire format.

There's a bunch of cases where the interpretation is ambiguous without
having a schema available (as in: the same exact byte sequence would be
perfectly sensible to parse under different possible schemas). In those
cases protoscope has to 'guess' what the type is based on some heuristics,
so in the round trip that you are testing it can't really know if it was
serialized as a bytes field or a packed field, and it just shows it as a
bytes field in this case.

On Tue, Aug 5, 2025 at 6:53 AM Andrei Pangratie <[email protected]> wrote:

> Hello,
>
> Something encoded with protoscope can't be decoded by protoscope, why?
>
> $ echo '0: { 1 2 3 4 5 6 7 8 1 1 1 1 1 1 1 1 1 1 1}' | protoscope -s | xxd
> -ps
> 021301020304050607080101010101010101010101
>
> $ echo 021301020304050607080101010101010101010101 | xxd -r -ps |
> protoscope
> `021301020304050607080101010101010101010101`
>
> I've compiled protoscope from here:
> https://github.com/protocolbuffers/protoscope.git commit
> 8e7a6aafa2c9958527b1e0747e66e1bfff045819. Is there a newer version of
> protoscope?
>
> --
> 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 view this discussion visit
> https://groups.google.com/d/msgid/protobuf/94703e12-5e56-4026-a6fc-bf8966dfd5fcn%40googlegroups.com
> <https://groups.google.com/d/msgid/protobuf/94703e12-5e56-4026-a6fc-bf8966dfd5fcn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion visit 
https://groups.google.com/d/msgid/protobuf/CAKRmVH_oEWKcB%3Dqyt4_J3e4BeHjfqDV_dycrQi0LOOuRLGDPPA%40mail.gmail.com.

Reply via email to