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