Update unicode.h
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
This commit is contained in:
parent
a9a2af93ed
commit
dccd1db48e
1 changed files with 2 additions and 1 deletions
|
@ -293,8 +293,9 @@ static uint32_t codepoint_from_utf8(const std::string& utf8, size_t& offset) {
|
||||||
static std::vector<uint32_t> codepoints_from_utf8(const std::string& utf8) {
|
static std::vector<uint32_t> codepoints_from_utf8(const std::string& utf8) {
|
||||||
std::vector<uint32_t> result;
|
std::vector<uint32_t> result;
|
||||||
size_t offset = 0;
|
size_t offset = 0;
|
||||||
while (offset < utf8.size())
|
while (offset < utf8.size()) {
|
||||||
result.push_back(codepoint_from_utf8(utf8, offset));
|
result.push_back(codepoint_from_utf8(utf8, offset));
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue