MCPcopy Index your code
hub / github.com/RustPython/RustPython / STORECHAR32

Function STORECHAR32

Lib/_pycodecs.py:470–479  ·  view source on GitHub ↗

Store a 32-bit character as 4 bytes in the specified byte order.

(ch, byteorder)

Source from the content-addressed store, hash-verified

468
469
470def STORECHAR32(ch, byteorder):
471 """Store a 32-bit character as 4 bytes in the specified byte order."""
472 b0 = ch & 0xFF
473 b1 = (ch >> 8) & 0xFF
474 b2 = (ch >> 16) & 0xFF
475 b3 = (ch >> 24) & 0xFF
476 if byteorder == "little":
477 return [b0, b1, b2, b3]
478 else: # big-endian
479 return [b3, b2, b1, b0]
480
481
482def PyUnicode_EncodeUTF32(s, size, errors, byteorder="little"):

Callers 1

PyUnicode_EncodeUTF32Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected