eea / odfpy

API for OpenDocument in Python
GNU General Public License v2.0
308 stars 63 forks source link

escaping: replace xml-1.0-illegal characters with question marks #72

Closed risicle closed 6 years ago

risicle commented 6 years ago

This is a strawman PR for #71

There are a number of open questions over this, but chiefly: is it better to silently swallow illegal characters or replace them with a placeholder. In this implementation I went for the latter, replacing them with question marks. Also if the latter, do we also add the ability to choose the placeholder?

I'd quite like to get a move on with this rather than debate it to death, but if needs be I'll maintain this fix on a fork of our own until this is sorted.

Test included.

risicle commented 6 years ago

I've pushed an update which uses the unicode "replacement character" instead of the question mark.