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.
codecs.readbuffer_encode()
1 parent 301b29d commit f1dcf3cCopy full SHA for f1dcf3c
Doc/library/codecs.rst
@@ -265,6 +265,20 @@ wider range of codecs when working with binary files:
265
:func:`iterencode`.
266
267
268
+.. function:: readbuffer_encode(buffer, errors=None, /)
269
+
270
+ Return a :class:`tuple` containing the raw bytes of *buffer*, a
271
+ :ref:`buffer-compatible object <bufferobjects>` or :class:`str`
272
+ (encoded to UTF-8 before processing), and their length in bytes.
273
274
+ The *errors* argument is ignored.
275
276
+ .. code-block:: pycon
277
278
+ >>> codecs.readbuffer_encode(b"Zito")
279
+ (b'Zito', 4)
280
281
282
The module also provides the following constants which are useful for reading
283
and writing to platform dependent files:
284
0 commit comments