Update unicode.h

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
This commit is contained in:
goerch 2023-10-02 09:19:06 +02:00 committed by GitHub
parent a9a2af93ed
commit dccd1db48e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) {
std::vector<uint32_t> result;
size_t offset = 0;
while (offset < utf8.size())
while (offset < utf8.size()) {
result.push_back(codepoint_from_utf8(utf8, offset));
}
return result;
}