Convert GBK to utf8 string in python

前端 未结 5 1869
面向向阳花
面向向阳花 2021-01-07 04:16

I have a string.

s = u\"

        
5条回答
  •  被撕碎了的回忆
    2021-01-07 04:53

    Take a look at unicodedata but I think one way to do this is:

    import unicodedata
    
    s = u""
    unicodedata.normalize('NFKD', s).encode('utf-8','ignore')
    

提交回复
热议问题