How to convert special characters into HTML entities?
I want to convert an arbitrary text into a text with the corresponding HTML-entities and I am searching for a dedicated Python module + method for replacing the special characters into HTML-entities. E.g. the conversion should be like ä -> ä ö -> ö ü -> ü ß -> ß I could do this for a couple of characters with a dictionary, but I want to have a comprehensive solution which covers all available characters outside the standard character set a-z and A-Z for many different languages. In the attached file https://code.sololearn.com/cn9CBAh8mLff/?ref=app where I use XML, the '<'-character is automatically converted into its entity <. Why does this not occur with the characters 'äöü'? How would I have to proceed to solve this?