原因:

在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. php-fig组织fig-standards的一些标准

    参考: http://psr.phphub.org/ https://github.com/php-fig/fig-standards https://github.com/PizzaLiu/PHP- ...

  2. javascript断点设置和调试

    JS调试必备的5个debug技巧http://www.jb51.net/article/47812.htm Chrome 中的 JavaScript 断点设置和调试技巧http://www.xuebu ...

  3. 分析并实现 360 P1路由器上的测速功能(也可以针对金山测速功能)

    现在各种智能路由器以及一些PC上的防火墙软件,都提供网络测速功能.笔者对此进行了研究,并在自己的路由器上也实现了此功能.下面做一下总结 一般的网络测速,主要关注两个方面:网络延迟和下载速率 1.网络延 ...

  4. libubox-ustream

    参考:libubox [4] - uloop runqueue ustream libubox提供了流缓冲管理,定义在文件ustream.h,ustream.c和ustream-fd.c. 1. 数据 ...

  5. Flex上传文件Java端解决中文乱码问题

    1.Flex端进行编码 public function encodeStr(str:String, charSet:String):String { var result:String =" ...

  6. 利用:header匹配所有标题做目录

    1.问题背景 查找到h1-h6,并遍历它们,打印出内容 2.实现源码 <!DOCTYPE html> <html> <head> <meta charset= ...

  7. 微信小程序4 - 几个ES6基础写法

    1. 默认参数 function demo(param){ param=param || {};} 新的写法,很直观 function demo(param={}){} 2. 简化方法,如你所见,de ...

  8. cocos2dx-是男人就坚持20s 练手项目

    前言 前段时间心血来潮看了下app游戏方面的东西 ,对比了下各种技术和市场招聘情况,赶脚cocos2dx在2D游戏方向还算是大有所为,遂找了几个基础教程看看了解了解.并附上一个简单demo作为成果 准 ...

  9. Tensorflow之计算tensor平均值

    https://www.tensorflow.org/versions/r0.12/api_docs/python/math_ops.html#reduce_mean tf.reduce_mean(i ...

  10. js禁止别人查看源码

    1.直接按F12 2.Ctrl+Shift+I查看 3.鼠标点击右键查看 4.Ctrl+u=view-source:+url 把以上三种状态都屏蔽掉就可以了,document有onkeydown(键盘 ...