From 40b3bfedf6d914dbefb1834f68a127ee1407b7c8 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Mon, 13 Feb 2023 14:19:43 -0500 Subject: Fixed the UnicodeDammit example so that the example is more obviously UTF-8. --- doc/source/index.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/source/index.rst b/doc/source/index.rst index 55dde0b..37ec7d8 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -2755,9 +2755,9 @@ whenever you have data in an unknown encoding and you just want it to become Unicode:: from bs4 import UnicodeDammit - dammit = UnicodeDammit("Sacr\xc3\xa9 bleu!") + dammit = UnicodeDammit(b"\xc2\xabSacr\xc3\xa9 bleu!\xc2\xbb") print(dammit.unicode_markup) - # Sacré bleu! + # «Sacré bleu!» dammit.original_encoding # 'utf-8' -- cgit v1.2.3