Store a 32-bit character as 4 bytes in the specified byte order.
(ch, byteorder)
| 468 | |
| 469 | |
| 470 | def 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 | |
| 482 | def PyUnicode_EncodeUTF32(s, size, errors, byteorder="little"): |
no outgoing calls
no test coverage detected