From 4878da5bd3884ca4f1fa1f7846664ebe23ac7b92 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 16 Sep 2024 14:36:10 +0200 Subject: [PATCH] PEP 756: Fix buffer format (#3967) Use the native encoding. "=I" size is 4 bytes on all platforms. --- peps/pep-0756.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/peps/pep-0756.rst b/peps/pep-0756.rst index 7782a5974..89aa38eeb 100644 --- a/peps/pep-0756.rst +++ b/peps/pep-0756.rst @@ -171,8 +171,8 @@ export format: Export format Buffer format Item size ========================== ================== ============ ``PyUnicode_FORMAT_UCS1`` ``"B"`` 1 byte -``PyUnicode_FORMAT_UCS2`` ``"H"`` 2 bytes -``PyUnicode_FORMAT_UCS4`` ``"I"`` or ``"L"`` 4 bytes +``PyUnicode_FORMAT_UCS2`` ``"=H"`` 2 bytes +``PyUnicode_FORMAT_UCS4`` ``"=I"`` 4 bytes ``PyUnicode_FORMAT_UTF8`` ``"B"`` 1 byte ``PyUnicode_FORMAT_ASCII`` ``"B"`` 1 byte ========================== ================== ============