| 598 | }; |
| 599 | |
| 600 | const char *getASCIISubstitution(uint32_t cp) |
| 601 | { |
| 602 | if ((0x00A0 <= cp) && (cp <= 0x00FF)) { |
| 603 | const char *base = kLatin1Base[cp - 0x00A0]; |
| 604 | if (base[0]) |
| 605 | return base; |
| 606 | } |
| 607 | |
| 608 | size_t lo = 0, hi = (sizeof(TABLE) / sizeof(TABLE[0])); |
| 609 | |
| 610 | while (lo < hi) { |
| 611 | size_t mid = lo + ((hi - lo) >> 1); |
| 612 | if (TABLE[mid].codepoint < cp) |
| 613 | lo = mid + 1; |
| 614 | else if (TABLE[mid].codepoint > cp) |
| 615 | hi = mid; |
| 616 | else |
| 617 | return TABLE[mid].ascii; |
| 618 | } |
| 619 | |
| 620 | return C_NULL; |
| 621 | } |
no outgoing calls
no test coverage detected