(self, str, encoding=None)
| 400 | |
| 401 | # Utility methods |
| 402 | def substituteEncoding(self, str, encoding=None): |
| 403 | encoding = encoding or "utf-8" |
| 404 | return str.replace("%SOUP-ENCODING%", encoding) |
| 405 | |
| 406 | def toEncoding(self, s, encoding=None): |
| 407 | """Encodes an object to a string in some encoding, or to Unicode. |