python3遇到的中文编码问题

使用百度NLP进行文本分析时,python3中会遭遇中文编码问题,文本自身是utf8编码,但部分字符不能直接转换为gbk编码,导致其自动转换功能出错。

搜索后发现可以这样解决:

 

str='中文字符'
message=str.encode('gbk','ignore').decode('gbk')

参考:

https://www.jianshu.com/p/047aa5ad8722


已发布

分类

,

来自

标签:

评论

《 “python3遇到的中文编码问题” 》 有 13 条评论

  1. acheter du androxal en pharmacie sans ordonnance

    buying androxal buy mastercard

  2. buy cheap enclomiphene generic germany

    order enclomiphene generic is it legal

  3. buy generic rifaximin no prescription

    cheapest buy rifaximin usa drugstore

  4. buy cheap xifaxan usa where to buy

    buying xifaxan cheap new zealand

  5. ordering avodart generic pharmacy usa

    ordering avodart cheap online no prescription

  6. online order flexeril cyclobenzaprine price on prescription

    get flexeril cyclobenzaprine without prescription

  7. buying dutasteride price uk

    buy dutasteride generic cheap

  8. how to get gabapentin

    ordering gabapentin cheap now

  9. gratuit kamagra

    acheter kamagra sans

  10. how to buy fildena purchase tablets

    buy cheap fildena purchase no prescription

  11. cheapest buy staxyn cheap where

    staxyn from mexico without prescription

  12. how to order itraconazole generic in us

    itraconazole cod no prescription required

  13. pナ册s noc kamagra bez lテゥkaナ冱kテゥho pナ册dpisu

    kamagra a interakce s léky vytorinem

回复 ordering gabapentin uk buy cheap 取消回复

您的邮箱地址不会被公开。 必填项已用 * 标注