added is_utf8 license

This commit is contained in:
TLINDEN
2016-01-15 21:06:18 +01:00
parent feaa022b10
commit a67149229f
2 changed files with 3 additions and 3 deletions

3
TODO
View File

@@ -15,8 +15,5 @@ vault checksum: add keysigs as well
Add newlines to headers in define.h, so strlen() later catches the whole length. Add newlines to headers in define.h, so strlen() later catches the whole length.
Check is_utf8 license.
also found in https://gd.meizo.com/_files/lpc/ext/utf8.c
c++ destructor double free mess c++ destructor double free mess

View File

@@ -35,6 +35,9 @@ static char *begins[] = {
/* via http://stackoverflow.com/a/1031773, slightly modified,
licensed under CC-BY-SA, written by Christoph
*/
uint8_t is_utf8(const byte *bytes) { uint8_t is_utf8(const byte *bytes) {
if( (// non-overlong 2-byte if( (// non-overlong 2-byte
(0xC2 <= bytes[0] && bytes[0] <= 0xDF) && (0xC2 <= bytes[0] && bytes[0] <= 0xDF) &&