iso-8859-15

How to normalize unicode encoding for iso-8859-15 conversion in python?

只谈情不闲聊 提交于 2020-01-02 08:03:10
问题 I want to convert unicode string into iso-8859-15. These strings include the u"\u2019" (RIGHT SINGLE QUOTATION MARK see http://www.fileformat.info/info/unicode/char/2019/index.htm) character which is not part of the iso-8859-15 characters set. In Python, how to normalize the unicode characters in order to match the iso-8859-15 encoding? I have looked at the unicodedata module without success. I manage to do the job with s.replace(u"\u2019", "'").encode('iso-8859-15') but I would like to find