| OLD | NEW |
| (Empty) | |
| 1 /* Copyright 2013 Google Inc. All Rights Reserved. |
| 2 |
| 3 Distributed under MIT license. |
| 4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT |
| 5 */ |
| 6 |
| 7 // Heuristics for deciding about the UTF8-ness of strings. |
| 8 |
| 9 #ifndef BROTLI_ENC_UTF8_UTIL_H_ |
| 10 #define BROTLI_ENC_UTF8_UTIL_H_ |
| 11 |
| 12 #include "./types.h" |
| 13 |
| 14 namespace brotli { |
| 15 |
| 16 static const double kMinUTF8Ratio = 0.75; |
| 17 |
| 18 // Returns true if at least min_fraction of the bytes between pos and |
| 19 // pos + length in the (data, mask) ringbuffer is UTF8-encoded. |
| 20 bool IsMostlyUTF8(const uint8_t* data, const size_t pos, const size_t mask, |
| 21 const size_t length, const double min_fraction); |
| 22 |
| 23 } // namespace brotli |
| 24 |
| 25 #endif // BROTLI_ENC_UTF8_UTIL_H_ |
| OLD | NEW |