MCPcopy Create free account
hub / github.com/cppla/ServerStatus / str_utf8_check

Function str_utf8_check

server/src/system.c:1971–1987  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1969}
1970
1971int str_utf8_check(const char *str)
1972{
1973 while(*str)
1974 {
1975 if((*str&0x80) == 0x0)
1976 str++;
1977 else if((*str&0xE0) == 0xC0 && (*(str+1)&0xC0) == 0x80)
1978 str += 2;
1979 else if((*str&0xF0) == 0xE0 && (*(str+1)&0xC0) == 0x80 && (*(str+2)&0xC0) == 0x80)
1980 str += 3;
1981 else if((*str&0xF8) == 0xF0 && (*(str+1)&0xC0) == 0x80 && (*(str+2)&0xC0) == 0x80 && (*(str+3)&0xC0) == 0x80)
1982 str += 4;
1983 else
1984 return 0;
1985 }
1986 return 1;
1987}
1988
1989
1990unsigned str_quickhash(const char *str)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected