Hi,

I've been using protobuf 3.5.1 in c++ and am using a message type with the 
following map type: `map<string, MyObject> txns = 1`

It is my understanding that `string` and `bytes` are the same in proto c++; 
for maps however one can only use `string` as keys. I'm using the key field 
to send around transaction digests which are byte strings consisting of 
cryptographic hashes. As far as I can tell, it makes no difference whether 
I use strings/bytes (the decoding works), yet I keep getting the error:
 
 `String field 'pequinstore.proto.MergedSnapshot.MergedTxnsEntry.key' 
contains invalid UTF-8 data when serializing a protocol buffer. Use the 
'bytes' type if you intend to send raw bytes.`

I understand the error is complaining about my digests possibly not being 
UTF-8, but I'm unsure if I actually need to be concerned about it; I have 
not noticed any problems with parsing. Is there a way to suppress this 
error?

Or, if this is a serious error that could lead to non-deterministic 
behavior, do you have a suggested workaround? There is a lot of existing 
code that uses the map structure akin to an STL map, so I'd like to avoid 
re-factoring the protobuf into a repeated field if possible. 

Thanks,
Florian

-- 
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 on the web visit 
https://groups.google.com/d/msgid/protobuf/dec5fc3f-83da-49a6-892b-3a6d73862aefn%40googlegroups.com.

Reply via email to