Logo Search packages:      
Sourcecode: wapiti version File versions  Download package

def BeautifulSoup::UnicodeDammit::subMSChar (   orig,
  smartQuotesTo 
)

Changes a MS smart quote character to an XML or HTML
entity.

Definition at line 1599 of file BeautifulSoup.py.

01599                                       :
        """Changes a MS smart quote character to an XML or HTML
        entity."""
        sub = UnicodeDammit.MS_CHARS.get(orig)
        if type(sub) == types.TupleType:
            if smartQuotesTo == 'xml':
                sub = '&#x%s;' % sub[1]
            elif smartQuotesTo == 'html':
                sub = '&%s;' % sub[0]
            else:
                sub = unichr(int(sub[1],16))
        return sub            
    subMSChar = staticmethod(subMSChar)


Generated by  Doxygen 1.6.0   Back to index