Skip to content

Commit

Permalink
Fix utf8 to unicode conversion
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas VIVIEN <[email protected]>
  • Loading branch information
progweb committed Aug 1, 2023
1 parent 6e60347 commit 865aeae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libutil/strutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1436,11 +1436,11 @@ decode(uint32_t* state, uint32_t* codep, uint32_t byte)
void
Strutil::utf8_to_unicode(string_view str, std::vector<uint32_t>& uvec)
{
const char* begin = str.begin();
const char* end = str.end();
uint32_t state = 0;
const char* begin = str.begin();
const char* end = str.end();
uint32_t state = 0;
uint32_t codepoint = 0;
for (; begin != end; ++begin) {
uint32_t codepoint = 0;
if (!decode(&state, &codepoint, (unsigned char)*begin))
uvec.push_back(codepoint);
}
Expand Down

0 comments on commit 865aeae

Please sign in to comment.