golang位移操作的一个小坑
基于ectd实现go的服务注册

go和python解码msgpack不一致

妙音 posted @ 2021年11月27日 18:37 in golang , 207 阅读
 

描述

 
    有一个消息字典类型, 使用go进行编码, 传入消息中间件。同时有一个python程序监听, 监听到消息之后进行解码, 遇到了编码问题
 
 

环境

 
go使用:     github.com/vmihailenco/msgpack/v5 v5.3.4
python使用: msgpack==1.0.2
 
 

python解码

 
# go编码的对象是个字典,value可能包含了数组,并且数组类型复杂
msgpack.unpackb(xxx)
 
 

错误提示

 
UnicodeDecodeError: 'utf-8' codec can't decode byte 0bx0 in position 0: invalid start byte
 

解决办法

 
msgpack.unpackb(xxx, raw=True)

#raw=True  解析为python字节类型
#raw=False 解析为python字符串, 默认使用utf-8编码
 
Avatar_small
YOLO 说:
2021年12月02日 19:51

slotok Just pick up the phone, whether the system

Avatar_small
seo 说:
2021年12月06日 05:12

This printing company helped me be efficient in directly marketing my business through postcards, newsletters, etc. A lot of time and money was spared just by availing their services. Check https://www.digitekprinting.com/adhesive-vinyl link out to see what I’m talking about.

Avatar_small
Harry 说:
2021年12月19日 17:53

I have been impressed after read this because of some quality work and informative thoughts. I just want to say thanks for the writer and wish you all the best for coming! Your exuberance is refreshing. 어벤져스카지노

Avatar_small
AAA 说:
2021年12月23日 16:53

Found your blog in the yahoo bulk shirts warehouse directory, very nice job, thanks. Screen printing could further supply for all types of other substrates from plastic to metal. Despite the fact that tiny and complex details can be gathered, screen printing is preferably ideal for bold and graphic designs. 안전놀이터

Avatar_small
Bairstow Pope 说:
2022年1月02日 09:50

I have been impressed after read this because of some quality work and informative thoughts. APKNames

Avatar_small
nedduane 说:
2022年1月05日 23:48

We offer Personalize Shopify order fulfillment service for eBay Amazon sellers dropship wholesale from China 1688

Avatar_small
building prive 说:
2022年1月07日 20:59

I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work...

Avatar_small
Click Here 说:
2022年1月08日 14:50

I am jovial you take pride in what you write. It makes you stand way out from many other writers that can not push high-quality content like you. <a href="images.google.co.za/url?q=https%3A%2F%2Fdailymagazinepure.com%2F">Click Here</a>
<a href="images.google.co.za/url?sa=t&url=https%3A%2F%2Fdailymagazinepure.com">Click Here</a>
<a href="images.google.co.za/url?sa=t&url=https%3A%2F%2Fdailymagazinepure.com%2F">Click Here</a>
<a href="images.google.co.za/url?sa=t&url=http%3A%2F%2Fdailymagazinepure.com">Click Here</a>
<a href="images.google.cl/url?sa=t&url=https%3A%2F%2Fdailymagazinepure.com%2F">Click Here</a>

Avatar_small
joker gaming 说:
2022年1月13日 13:21

Your blog is too much amazing. I have found with ease what I was looking. Moreover, the content quality is awesome. Thanks for the nudge!

Avatar_small
Digital_Zone 说:
2022年1月15日 23:08

Please let me know if you’re looking for a article writer for your site. You have some really great posts and I feel I would be a good asset. If you ever want to take some of the load off, I’d absolutely love to write some material for your blog in exchange for a link back to mine. Please send me an email if interested. Thank you! Zonnepanelen Dessel

Avatar_small
Digital_Zone 说:
2022年1月15日 23:14

I can’t imagine focusing long enough to research; much less write this kind of article. You’ve outdone yourself with this material. This is great content. Zonnepanelen Haacht

Avatar_small
Digital_Zone 说:
2022年1月15日 23:23

Really a great addition. I have read this marvelous post. Thanks for sharing information about it. I really like that. Thanks so lot for your convene. Ramen en deuren Holsbeek

Avatar_small
Digital_Zone 说:
2022年1月15日 23:26

I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work. Zonnepanelen Halle

Avatar_small
Digital_Zone 说:
2022年1月15日 23:28

Wow, excellent post. I'd like to draft like this too - taking time and real hard work to make a great article. This post has encouraged me to write some posts that I am going to write soon. Ramen en deuren Wilsele

Avatar_small
Digital_Zone 说:
2022年1月15日 23:46

Pretty good post. I have just stumbled upon your blog and enjoyed reading your blog posts very much. I am looking for new posts to get more precious info. Big thanks for the useful info. Zonnepanelen Herent

Avatar_small
Digital_Zone 说:
2022年1月15日 23:49

I know this is one of the most meaningful information for me. And I'm animated reading your article. But should remark on some general things, the website style is perfect; the articles are great. Thanks for the ton of tangible and attainable help. Ramen en deuren Kessel-Lo

Avatar_small
Digital_Zone 说:
2022年1月15日 23:52

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me. Zonnepanelen Herne

Avatar_small
Digital_Zone 说:
2022年1月15日 23:56

Fabulous post, you have denoted out some fantastic points, I likewise think this s a very wonderful website. I will visit again for more quality contents and also, recommend this site to all. Thanks. Ramen en deuren Oud-Heverlee

Avatar_small
Digital_Zone 说:
2022年1月16日 00:00

An interesting dialogue is price comment. I feel that it is best to write more on this matter, it may not be a taboo topic however usually individuals are not enough to talk on such topics. To the next. Cheers. Zonnepanelen Hoegaarden

Avatar_small
Digital_Zone 说:
2022年1月16日 00:03

You delivered such an impressive piece to read, giving every subject enlightenment for us to gain information. Thanks for sharing such information with us due to which my several concepts have been cleared. Ramen en deuren Wijchmaal

Avatar_small
Digital_Zone 说:
2022年1月16日 00:06

Very useful post. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. Really its great article. Keep it up. Zonnepanelen Hoeilaart

Avatar_small
Digital_Zone 说:
2022年1月16日 00:14

This particular papers fabulous, and My spouse and i enjoy each of the perform that you have placed into this. I’m sure that you will be making a really useful place. I has been additionally pleased. Good perform! Ramen en deuren Rotselaar

Avatar_small
Digital_Zone 说:
2022年1月16日 00:22

I recently found many useful information in your website especially this blog page. Among the lots of comments on your articles. Thanks for sharing. Zonnepanelen Holsbeek

Avatar_small
Digital_Zone 说:
2022年1月16日 00:24

Only aspire to mention ones content can be as incredible. This clarity with your post is superb and that i may think you’re a guru for this issue. High-quality along with your concur permit me to to seize your current give to keep modified by using approaching blog post. Thanks a lot hundreds of along with you should go on the pleasurable get the job done. Ramen en deuren Bertem

Avatar_small
Digital_Zone 说:
2022年1月16日 00:27

Thanks for an interesting blog. What else may I get that sort of info written in such a perfect approach? I have an undertaking that I am just now operating on, and I have been on the lookout for such info. Zonnepanelen Huldenberg

Avatar_small
Digital_Zone 说:
2022年1月16日 00:30

i am for the first time here. I found this board and I in finding It truly helpful & it helped me out a lot. I hope to present something back and help others such as you helped me. Ramen en deuren Vlaams-Brabant

Avatar_small
Digital_Zone 说:
2022年1月16日 00:34

Succeed! It could be one of the most useful blogs we have ever come across on the subject. Excellent info! I’m also an expert in this topic so I can understand your effort very well. Thanks for the huge help. Zonnepanelen Kampenhout

Avatar_small
Digital_Zone 说:
2022年1月16日 00:37

Hey, this day is too much good for me, since this time I am reading this enormous informative article here at my home. Thanks a lot for massive hard work. Ramen en deuren Aarschot

Avatar_small
Digital_Zone 说:
2022年1月16日 00:40

Impressive web site, Distinguished feedback that I can tackle. Im moving forward and may apply to my current job as a pet sitter, which is very enjoyable, but I need to additional expand. Regards. Zonnepanelen Kapelle-op-den-bos

Avatar_small
Digital_Zone 说:
2022年1月16日 00:44

This article was written by a real thinking writer without a doubt. I agree many of the with the solid points made by the writer. I’ll be back day in and day for further new updates. Ramen en deuren Bierbeek

Avatar_small
Digital_Zone 说:
2022年1月16日 01:15

I visit your blog regularly and recommend it to all of those who wanted to enhance their knowledge with ease. The style of writing is excellent and also the content is top-notch. Thanks for that shrewdness you provide the readers! Zonnepanelen Keerbergen

Avatar_small
Digital_Zone 说:
2022年1月16日 01:15

That is the excellent mindset, nonetheless is just not help to make every sence whatsoever preaching about that mather. Virtually any method many thanks in addition to i had endeavor to promote your own article in to delicius nevertheless it is apparently a dilemma using your information sites can you please recheck the idea. thanks once more. Ramen en deuren Boortmeerbeek

Avatar_small
Digital_Zone 说:
2022年1月16日 01:15

Your content is nothing short of brilliant in many ways. I think this is engaging and eye-opening material. Thank you so much for caring about your content and your readers. Zonnepanelen Kortenaken

Avatar_small
Digital_Zone 说:
2022年1月16日 01:15

You have done a great job on this article. It’s very readable and highly intelligent. You have even managed to make it understandable and easy to read. You have some real writing talent. Thank you. Ramen en deuren Boutersem

Avatar_small
Digital_Zone 说:
2022年1月16日 01:16

It is my first visit to your blog, and I am very impressed with the articles that you serve. Give adequate knowledge for me. Thank you for sharing useful material. I will be back for the more great post. Zonnepanelen Brecht

Avatar_small
Harry 说:
2022年1月19日 22:06

I have been impressed after read this because of some quality work and informative thoughts. spbo


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter