xref: /aosp_15_r20/external/grpc-grpc/third_party/utf8_range/utf8_range.h (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1 #ifndef THIRD_PARTY_UTF8_RANGE_UTF8_RANGE_H_
2 #define THIRD_PARTY_UTF8_RANGE_UTF8_RANGE_H_
3 
4 #include <stddef.h>
5 
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 
10 // Returns 1 if the sequence of characters is a valid UTF-8 sequence, otherwise
11 // 0.
12 int utf8_range_IsValid(const char* data, size_t len);
13 
14 // Returns the length in bytes of the prefix of str that is all
15 // structurally valid UTF-8.
16 size_t utf8_range_ValidPrefix(const char* data, size_t len);
17 
18 #ifdef __cplusplus
19 }  // extern "C"
20 #endif
21 
22 #endif  // THIRD_PARTY_UTF8_RANGE_UTF8_RANGE_H_
23