Return whether name is valid UTF-8. If not, set status to kRegexpBadUTF8.
| 1415 | // Return whether name is valid UTF-8. |
| 1416 | // If not, set status to kRegexpBadUTF8. |
| 1417 | static 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? |
| 1428 | static int IsHex(int c) { |
no test coverage detected