我们从Python开源项目中,提取了以下25个代码示例,用于说明如何使用copy.original_encoding()。
def test_copy_preserves_encoding(self): soup = BeautifulSoup(b'<p> </p>', 'html.parser') encoding = soup.original_encoding copy = soup.__copy__() self.assertEqual("<p> </p>", str(copy)) self.assertEqual(encoding, copy.original_encoding)
def test_copy_preserves_encoding(self): soup = BeautifulSoup(b'<p> </p>', 'html.parser') encoding = soup.original_encoding copy = soup.__copy__() self.assertEqual(u"<p> </p>", unicode(copy)) self.assertEqual(encoding, copy.original_encoding)