How can I detect the encoding/codepage of a text file

后端 未结 20 1380
梦如初夏
梦如初夏 2020-11-21 22:42

In our application, we receive text files (.txt, .csv, etc.) from diverse sources. When reading, these files sometimes contain garbage, because the

相关标签:
20条回答
  • 2020-11-21 23:30

    Open file in AkelPad(or just copy/paste a garbled text), go to Edit -> Selection -> Recode... -> check "Autodetect".

    0 讨论(0)
  • 2020-11-21 23:31

    The StreamReader class's constructor takes a 'detect encoding' parameter.

    0 讨论(0)
提交回复
热议问题