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