Handling non-standard American English Characters and Symbols in a CSV, using Python

后端 未结 2 1172
轮回少年
轮回少年 2020-12-18 07:16

I have a list of store names, with a few thousand names, some of which have non-standard American English characters that are posing a problem.

For example, my inpu

2条回答
  •  鱼传尺愫
    2020-12-18 08:09

    You can use decode and encode:

    print a
    péché
    Álak
    óundle
    
    print a.decode('latin9').encode('utf8'),
    péché
    Ãlak
    óundle
    

    I had to do the reverse...

提交回复
热议问题