| 550 | } |
| 551 | |
| 552 | cc_bool Convert_TryCodepointToCP437(cc_codepoint cp, char* c) { |
| 553 | int i; |
| 554 | if (cp >= 0x20 && cp < 0x7F) { *c = (char)cp; return true; } |
| 555 | if (cp >= 0x1F000) cp = ReduceEmoji(cp); |
| 556 | |
| 557 | for (i = 0; i < Array_Elems(controlChars); i++) { |
| 558 | if (controlChars[i] == cp) { *c = i; return true; } |
| 559 | } |
| 560 | for (i = 0; i < Array_Elems(extendedChars); i++) { |
| 561 | if (extendedChars[i] == cp) { *c = i + 0x7F; return true; } |
| 562 | } |
| 563 | |
| 564 | *c = '?'; return false; |
| 565 | } |
| 566 | |
| 567 | int Convert_Utf8ToCodepoint(cc_codepoint* cp, const cc_uint8* data, cc_uint32 len) { |
| 568 | *cp = '\0'; |
no test coverage detected