Chromium Code Reviews| Index: src/unicode-inl.h |
| diff --git a/src/unicode-inl.h b/src/unicode-inl.h |
| index b22e4825280dc78836dcb4e032fec65c614dbcd7..ebebfaa1bd9c158a098a602311a9406083505e02 100644 |
| --- a/src/unicode-inl.h |
| +++ b/src/unicode-inl.h |
| @@ -137,6 +137,12 @@ unsigned Utf8::Length(uchar c, int previous) { |
| } |
| } |
| +bool Utf8::IsValidCharacter(uchar c) { |
| + return c < 0xD800u || (c >= 0xE000u && c < 0xFDD0u) || |
| + (c > 0xFDEFu && c <= 0x10FFFFu && (c & 0xFFFEu) != 0xFFFEu && |
| + c != kBadChar); |
| +} |
| + |
| } // namespace unibrow |
| #endif // V8_UNICODE_INL_H_ |