+ def _clean_key(self, key):
+ """Replace spaces in keys with \\u00B7 (middle dot).
+
+ This character is deemed unlikely to occur in keys to our
+ playlist and curve info dictionaries, while many keys have
+ spaces in them.
+
+ \\u00B7 is allowed in XML 1.0 as of the 5th edition. See
+ the `4th edition errata`_ for details.
+
+ .. _4th edition errata:
+ http://www.w3.org/XML/xml-V10-4e-errata#E09
+ """
+ return key.replace(' ', u'\u00B7')
+
+ def _restore_key(self, key):
+ """Restore keys encoded with :meth:`_clean_key`.
+ """
+ return key.replace(u'\u00B7', ' ')
+