MCPcopy Create free account
hub / github.com/crosspoint-reader/crosspoint-reader / mayContainRtlBytes

Function mayContainRtlBytes

lib/Epub/Epub/ParsedText.cpp:30–35  ·  view source on GitHub ↗

Byte-level pre-check: Hebrew UTF-8 lead bytes 0xD6-0xD7, Arabic/Syriac 0xD8-0xDB.

Source from the content-addressed store, hash-verified

28
29// Byte-level pre-check: Hebrew UTF-8 lead bytes 0xD6-0xD7, Arabic/Syriac 0xD8-0xDB.
30bool mayContainRtlBytes(const char* str) {
31 for (const auto* p = reinterpret_cast<const unsigned char*>(str); *p; ++p) {
32 if (*p >= 0xD6 && *p <= 0xDB) return true;
33 }
34 return false;
35}
36
37// Returns the first rendered codepoint of a word (skipping leading soft hyphens).
38uint32_t firstCodepoint(const std::string& word) {

Callers 1

addWordMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected