more dummies
just to sketch out the final implementation
This commit is contained in:
@@ -5,13 +5,20 @@
|
||||
|
||||
// translates the next unicode UTF-8 item to 2-byte "code points" (reduced UTF-16)
|
||||
uint16_t unicodeToWchar16(const char* utf8, size_t maxLen) {
|
||||
// to be implemented
|
||||
// TODO: implement proper UTF‑8 → reduced UTF‑16 decoding
|
||||
(void)utf8;
|
||||
(void)maxLen;
|
||||
return 0; // sentinel: "no character"
|
||||
}
|
||||
|
||||
// returns a pointer to the next unicode item - can be used to "advance" conversion after unicodeToWchar16()
|
||||
// return nullptr at end of input
|
||||
const char* nextUnicode(const char* utf8, size_t maxLen) {
|
||||
// to be implemented
|
||||
(void)maxLen;
|
||||
if (!utf8) return nullptr;
|
||||
if (strlen(utf8)>0) return utf8+1;
|
||||
else return nullptr; // last code read
|
||||
// TODO: implement proper UTF‑8 iteration
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user