| 527 | |
| 528 | |
| 529 | size_t UTF8CodepointPos(const std::string& s8, size_t endIndex) { |
| 530 | size_t pos = 0; |
| 531 | size_t index = 0; |
| 532 | while (index < endIndex && pos < s8.size()) { |
| 533 | size_t newPos = UTF8NextCodepoint(s8, pos); |
| 534 | // Check if codepoint is invalid |
| 535 | if (pos == newPos) |
| 536 | return pos; |
| 537 | pos = newPos; |
| 538 | index++; |
| 539 | } |
| 540 | return pos; |
| 541 | } |
| 542 | |
| 543 | |
| 544 | #if defined ARCH_WIN |
nothing calls this directly
no test coverage detected