Decryption - How to use python to decode some Chinese garbled characters?
迷茫2017-07-05 10:35:24
0
3
1041
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?
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.
Notepad++ opens the csv and can convert the encoding to utf-8 without BOM, and then check if it is still garbled
Open the csv with notepad, it will tell you what encoding it is
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.Chardet
Introduction: http://hao.jobbole.com/chardet/