summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2023-02-13 14:19:43 -0500
committerLeonard Richardson <leonardr@segfault.org>2023-02-13 14:19:43 -0500
commit40b3bfedf6d914dbefb1834f68a127ee1407b7c8 (patch)
tree577da8f530d06f8af87473a6bc257b1306d5b086 /doc
parent172c1cf61b979e07f5534563e4926d00e7edd521 (diff)
Fixed the UnicodeDammit example so that the example is more obviously UTF-8.
Diffstat (limited to 'doc')
-rw-r--r--doc/source/index.rst4
1 files changed, 2 insertions, 2 deletions
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'