Lines Matching refs:xml_data
1848 def _detectEncoding(self, xml_data, isHTML=False): argument
1852 if xml_data[:4] == '\x4c\x6f\xa7\x94':
1854 xml_data = self._ebcdic_to_ascii(xml_data)
1855 elif xml_data[:4] == '\x00\x3c\x00\x3f':
1858 xml_data = unicode(xml_data, 'utf-16be').encode('utf-8')
1859 elif (len(xml_data) >= 4) and (xml_data[:2] == '\xfe\xff') \
1860 and (xml_data[2:4] != '\x00\x00'):
1863 xml_data = unicode(xml_data[2:], 'utf-16be').encode('utf-8')
1864 elif xml_data[:4] == '\x3c\x00\x3f\x00':
1867 xml_data = unicode(xml_data, 'utf-16le').encode('utf-8')
1868 elif (len(xml_data) >= 4) and (xml_data[:2] == '\xff\xfe') and \
1869 (xml_data[2:4] != '\x00\x00'):
1872 xml_data = unicode(xml_data[2:], 'utf-16le').encode('utf-8')
1873 elif xml_data[:4] == '\x00\x00\x00\x3c':
1876 xml_data = unicode(xml_data, 'utf-32be').encode('utf-8')
1877 elif xml_data[:4] == '\x3c\x00\x00\x00':
1880 xml_data = unicode(xml_data, 'utf-32le').encode('utf-8')
1881 elif xml_data[:4] == '\x00\x00\xfe\xff':
1884 xml_data = unicode(xml_data[4:], 'utf-32be').encode('utf-8')
1885 elif xml_data[:4] == '\xff\xfe\x00\x00':
1888 xml_data = unicode(xml_data[4:], 'utf-32le').encode('utf-8')
1889 elif xml_data[:3] == '\xef\xbb\xbf':
1892 xml_data = unicode(xml_data[3:], 'utf-8').encode('utf-8')
1899 xml_encoding_match = re.compile(xml_encoding_re).match(xml_data)
1903 xml_encoding_match = regexp.search(xml_data)
1915 return xml_data, xml_encoding, sniffed_xml_encoding