sheredom / utf8.h

📚 single header utf8 string functions for C and C++
The Unlicense
1.74k stars 127 forks source link

Why does the string length include the terminating char? #7

Closed f2404 closed 8 years ago

f2404 commented 8 years ago
  // we are including the null terminating byte in the size calculation
  size++;
sheredom commented 8 years ago

That is in utf8size, not utf8len. Size is for the number of bytes of memory required to take the utf8 string (so needs the terminating \0)

f2404 commented 8 years ago

Ok, got it.