None
(data, errors="strict", byteorder=0, final=0)
| 261 | |
| 262 | |
| 263 | def utf_32_ex_decode(data, errors="strict", byteorder=0, final=0): |
| 264 | """None""" |
| 265 | if byteorder == 0: |
| 266 | if len(data) < 4: |
| 267 | if final and len(data): |
| 268 | if sys.byteorder == "little": |
| 269 | bm = "little" |
| 270 | else: |
| 271 | bm = "big" |
| 272 | res, consumed, _ = PyUnicode_DecodeUTF32Stateful( |
| 273 | data, len(data), errors, bm, final |
| 274 | ) |
| 275 | return "".join(res), consumed, 0 |
| 276 | return "", 0, 0 |
| 277 | if data[0:4] == b"\xff\xfe\x00\x00": |
| 278 | res, consumed, _ = PyUnicode_DecodeUTF32Stateful( |
| 279 | data[4:], len(data) - 4, errors, "little", final |
| 280 | ) |
| 281 | return "".join(res), consumed + 4, -1 |
| 282 | if data[0:4] == b"\x00\x00\xfe\xff": |
| 283 | res, consumed, _ = PyUnicode_DecodeUTF32Stateful( |
| 284 | data[4:], len(data) - 4, errors, "big", final |
| 285 | ) |
| 286 | return "".join(res), consumed + 4, 1 |
| 287 | if sys.byteorder == "little": |
| 288 | bm = "little" |
| 289 | else: |
| 290 | bm = "big" |
| 291 | res, consumed, _ = PyUnicode_DecodeUTF32Stateful( |
| 292 | data, len(data), errors, bm, final |
| 293 | ) |
| 294 | return "".join(res), consumed, 0 |
| 295 | |
| 296 | if byteorder == -1: |
| 297 | res, consumed, _ = PyUnicode_DecodeUTF32Stateful( |
| 298 | data, len(data), errors, "little", final |
| 299 | ) |
| 300 | return "".join(res), consumed, -1 |
| 301 | |
| 302 | res, consumed, _ = PyUnicode_DecodeUTF32Stateful( |
| 303 | data, len(data), errors, "big", final |
| 304 | ) |
| 305 | return "".join(res), consumed, 1 |
| 306 | |
| 307 | |
| 308 | def _is_hex_digit(b): |
nothing calls this directly
no test coverage detected