We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 276d8cd commit 2306fcdCopy full SHA for 2306fcd
Doc/extending/first-extension-module.rst
@@ -391,10 +391,10 @@ There's a slight type mismatch here: Python's :py:class:`str` objects store
391
Unicode text, but C strings are arrays of bytes.
392
So, we'll need to *encode* the data, and we'll use the UTF-8 encoding for it.
393
(UTF-8 might not always be correct for system commands, but it's what
394
-:py:meth:`str.decode` uses by default,
+:py:meth:`str.encode` uses by default,
395
and the C API has special support for it.)
396
397
-The function to decode a Python string into a UTF-8 buffer is named
+The function to encode a Python string into a UTF-8 buffer is named
398
:c:func:`PyUnicode_AsUTF8` [#why-pyunicodeasutf8]_.
399
Call it like this:
400
0 commit comments