comparison mupdf-source/thirdparty/brotli/c/enc/utf8_util.h @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
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 <brotli/types.h>
13
14 #include "../common/platform.h"
15
16 #if defined(__cplusplus) || defined(c_plusplus)
17 extern "C" {
18 #endif
19
20 static const double kMinUTF8Ratio = 0.75;
21
22 /* Returns 1 if at least min_fraction of the bytes between pos and
23 pos + length in the (data, mask) ring-buffer is UTF8-encoded, otherwise
24 returns 0. */
25 BROTLI_INTERNAL BROTLI_BOOL BrotliIsMostlyUTF8(
26 const uint8_t* data, const size_t pos, const size_t mask,
27 const size_t length, const double min_fraction);
28
29 #if defined(__cplusplus) || defined(c_plusplus)
30 } /* extern "C" */
31 #endif
32
33 #endif /* BROTLI_ENC_UTF8_UTIL_H_ */