wire_format.cc:1091] String field 'accountid' contains invalid UTF-8 data when serializing a protocol buffer. Use the 'bytes' type if you intend to send raw bytes.


原因:

在protobuf 的string字段中存在中文,序列化的时候会出现截断数据,string这个类型带有检查功能

解决方法:

把protobuf中存在中文的string字段类型 改为bytes

string的序列化函数多以下代码

::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->strdeptname().data(), this->strdeptname().length(),
::google::protobuf::internal::WireFormat::PARSE,
"strdeptname");


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM