Changes a MS smart quote character to an XML or HTML entity.
(self, orig)
| 1801 | if not u: self.originalEncoding = None |
| 1802 | |
| 1803 | def _subMSChar(self, orig): |
| 1804 | """Changes a MS smart quote character to an XML or HTML |
| 1805 | entity.""" |
| 1806 | sub = self.MS_CHARS.get(orig) |
| 1807 | if isinstance(sub, tuple): |
| 1808 | if self.smartQuotesTo == 'xml': |
| 1809 | sub = '&#x%s;' % sub[1] |
| 1810 | else: |
| 1811 | sub = '&%s;' % sub[0] |
| 1812 | return sub |
| 1813 | |
| 1814 | def _convertFrom(self, proposed): |
| 1815 | proposed = self.find_codec(proposed) |