MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / IsValidUTF8

Function IsValidUTF8

extern/re2/re2/parse.cc:1417–1425  ·  view source on GitHub ↗

Return whether name is valid UTF-8. If not, set status to kRegexpBadUTF8.

Source from the content-addressed store, hash-verified

1415// Return whether name is valid UTF-8.
1416// If not, set status to kRegexpBadUTF8.
1417static bool IsValidUTF8(const StringPiece& s, RegexpStatus* status) {
1418 StringPiece t = s;
1419 Rune r;
1420 while (!t.empty()) {
1421 if (StringPieceToRune(&r, &t, status) < 0)
1422 return false;
1423 }
1424 return true;
1425}
1426
1427// Is c a hex digit?
1428static int IsHex(int c) {

Callers 2

ParseUnicodeGroupFunction · 0.85
ParsePerlFlagsMethod · 0.85

Calls 2

StringPieceToRuneFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected