sheredom / utf8.h

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

int might be too small for a code point #10

Closed fluks closed 8 years ago

fluks commented 8 years ago

utf8chr uses an int type, which can be 16 bits wide, for chr code point argument. Maximum code point is 0x10FFFF which is more than 16 bits. To be more portable, chr argument's type should be something that is always large enough, maybe long if you don't want to include stdint.h.

sheredom commented 8 years ago

Good catch! I'll rework :)

sheredom commented 8 years ago

https://github.com/sheredom/utf8.h/pull/11 is testing the fix for this now!

Gumichan01 commented 8 years ago

@sheredom : I don't really know why your fix did not pass the travis tests. I have made another fix that seems identical with yours and it passed all of the tests. I created a new pull request #15 for that

sheredom commented 8 years ago

@Gumichan01 Thanks a ton - your MR did indeed work a charm and I can close this issue :smile: