原因:

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

解决方法:

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

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

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

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.的更多相关文章

  1. String field contains invalid UTF-8 data when serializing a protocol buffer. Use the 'bytes' type if you intend to send raw bytes.

    [libprotobuf ERROR google/protobuf/wire_format.cc:1053] String field contains invalid UTF-8 data whe ...

  2. mongodb 更新数组出现can't append to array using string field name

    数据库内容大概如下: { _id:, "hero_list" : { " : { , , "equip" : [ [ ], [ ], [ ], { , ...

  3. 54.string field聚合以及fielddata原理初探

    主要知识点: 直接对分词的term进行聚合后果 设置fielddata=true 直接用.keyword进行聚合 doc value 的性能问题     一.直接对分词的term进行聚合后果     ...

  4. 融合libevent和protobuf

    写了一个简单的例子,把libevent中的bufferevent网络收发服务和protobuf里面的序列反序列结合起来. protobuf文件message.proto: message PMessa ...

  5. gPRC学习笔记

    gPRC学习笔记 gPRC基础教程. gPRC官方文档. protobuf 3.0的简易教程. 什么是RPC RPC(remote procedure call) -- 远程过程调用(相对于本地调用的 ...

  6. C++开源代码项目汇总

    Google的C++开源代码项目 v8  -  V8 JavaScript EngineV8 是 Google 的开源 JavaScript 引擎.V8 采用 C++ 编写,可在谷歌浏览器(来自 Go ...

  7. 字段值为 null 时,序列化或反序列化成其他值

    using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using System; using System.Collections.G ...

  8. protocol buffer开发指南

    ProtoBuf 是一套接口描述语言(IDL)和相关工具集(主要是 protoc,基于 C++ 实现),类似 Apache 的 Thrift).用户写好 .proto 描述文件,之后使用 protoc ...

  9. 高效的数据压缩编码方式 Protobuf

    一. protocol buffers 是什么? Protocol buffers 是一种语言中立,平台无关,可扩展的序列化数据的格式,可用于通信协议,数据存储等. Protocol buffers ...

随机推荐

  1. mysql数据库中不能插入0000-00-00 00:00:00日期数据(报错Invalid datetime format: 1292 Incorrect datetime value: '0000-00-00 00:00:00')

    报错信息 SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '0000-00-00 00:00:00' ...

  2. void *指针的加减运算

    1.手工写了一个程序验证void *指针加减运算移动几个字节: //本程序验证空类型指针减1移动几个字节 #include <stdio.h> int main(int argc, cha ...

  3. 二次开发第N天。。。。。。。。自动分页问题

    phpcms\modules\content\fields\pages\form.inc.php 注意修改时,如果是gbk版本可以直接用记事本修改保存!如果是utf8 要用工具修改,或者保存的时候要记 ...

  4. ArcGIS教程:将“替换为模型”工具用于多面体

    替换为模型工具出如今 3D 编辑器 工具条上的 3D 编辑器菜单中.而且仅仅适用于多面体要素.使用此命令可将所选的一个或多个要素的几何替换为磁盘中所保存的 3D 模型文件.受支持的 3D 模型类型包含 ...

  5. 495. Implement Stack【easy】

    Implement a stack. You can use any data structure inside a stack except stack itself to implement it ...

  6. 河南省第七届ACM程序设计大赛赛后总结

    我们学校ACM集训开始于4月5号(清明节),5月25日在郑州解放军信息工程大学举办,集训耗时50天,但是感觉效果还行,但是也不是太好:我们也已经尽力了,虽然说只拿了个银牌,每份收获的背后,都会有辛勤的 ...

  7. myeclipse能启动tomcat但是用startup.bat无法启动

    myeclipse能启动tomcat但是用startup.bat无法启动 这个问题困扰了我一天,把一天的周末时间白白花费了.各种百度,各种尝试都没办法解决.在江湖上闯,难道就只有百度一招吗? 不是,我 ...

  8. C预编译宏

    /* ============================================================================ Name : c_test001.c A ...

  9. Unix系统编程()文件空洞

    如果程序的文件偏移量已然跨越了文件结尾,然后再执行IO操作,将会发生什么情况? read调用将会返回0,表示文件结尾.令人惊讶的是,write函数可以在文件结尾后的任意位置写入数据. 从文件结尾后到新 ...

  10. chckbox多选

    1.HTML结构 <input type="checkbox" name="test" value="1"/><span& ...