开发者

How can I tell a string is encoded from db.model_to_protobuf

开发者 https://www.devze.com 2023-01-28 08:09 出处:网络
I use db.model_to_protobuf for my AppEngine project, I wonder if is there a way to tell a string is encoded from db.model_to_protobuf? I have no time to read the source cod开发者_运维百科e, can anyone

I use db.model_to_protobuf for my AppEngine project, I wonder if is there a way to tell a string is encoded from db.model_to_protobuf? I have no time to read the source cod开发者_运维百科e, can anyone give me a favour?

Thanks~


In principle, yes - the protocol buffer encoding format is documented here. In practice, this is a terrible idea: you should use metadata to identify the format of your data, and decode it based on that, not based on trying to guess the content type.

0

精彩评论

暂无评论...
验证码 换一张
取 消