search

Home  >  Q&A  >  body text

Decryption - How to use python to decode some Chinese garbled characters?

In English win10, I use excel to open a csv file containing Chinese characters exported from other software. The Chinese characters become garbled. If I use python, can I decode it into correct Chinese characters? How to do it?

迷茫迷茫2732 days ago1044

reply all(3)I'll reply

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-07-05 10:37:24

    Notepad++ opens the csv and can convert the encoding to utf-8 without BOM, and then check if it is still garbled

    reply
    0
  • 巴扎黑

    巴扎黑2017-07-05 10:37:24

    Open the csv with notepad, it will tell you what encoding it is

    reply
    0
  • 習慣沉默

    習慣沉默2017-07-05 10:37:24

    You can try the Chardet package, which can detect most commonly used encodings, determine the encoding first, and then convert the encoding. If the encoding cannot be detected, it should be really garbled.

    ChardetIntroduction: http://hao.jobbole.com/chardet/

    reply
    1
  • Cancelreply