A resilient, actually working CSV implementation for non-ascii?

前端 未结 4 2217
萌比男神i
萌比男神i 2020-12-30 06:30

[Update] Appreciate the answers and input all around, but working code would be most welcome. If you can supply code that can read the sample files you are

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-30 07:02

    I don't know if you've already tried this, but in the example section for the official Python documentation for the csv module, you'll find a pair of classes; UnicodeReader and UnicodeWriter. They worked fine for me so far.

    Correctly detecting the encoding of a file seems to be a very hard problem. You can read the discussion in this StackOverflow thread.

提交回复
热议问题