Main Page
+
Namespaces
Namespace List
+
Namespace Members
+
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
+
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
+
Variables
c
d
e
f
g
i
k
l
m
n
o
r
s
t
z
+
Typedefs
a
c
d
e
f
g
h
i
l
m
n
p
r
s
t
u
v
w
y
z
Enumerations
+
Enumerator
k
l
p
s
+
Classes
Class List
Class Hierarchy
+
Class Members
+
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
~
+
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
z
+
Typedefs
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
Enumerations
+
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
x
z
+
Related Functions
a
b
c
e
f
h
i
m
o
p
r
s
t
u
v
w
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
x
+
Functions
_
a
c
g
m
n
r
s
t
v
+
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
v
Typedefs
Enumerations
Enumerator
+
Macros
_
a
c
d
e
f
g
h
i
l
n
p
r
s
t
u
x
abseil_cpp
absl
strings
internal
utf8.h
Go to the documentation of this file.
1
// Copyright 2017 The Abseil Authors.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// https://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
//
15
// UTF8 utilities, implemented to reduce dependencies.
16
17
#ifndef ABSL_STRINGS_INTERNAL_UTF8_H_
18
#define ABSL_STRINGS_INTERNAL_UTF8_H_
19
20
#include <cstddef>
21
#include <cstdint>
22
23
namespace
absl
{
24
namespace
strings_internal {
25
26
// For Unicode code points 0 through 0x10FFFF, EncodeUTF8Char writes
27
// out the UTF-8 encoding into buffer, and returns the number of chars
28
// it wrote.
29
//
30
// As described in https://tools.ietf.org/html/rfc3629#section-3 , the encodings
31
// are:
32
// 00 - 7F : 0xxxxxxx
33
// 80 - 7FF : 110xxxxx 10xxxxxx
34
// 800 - FFFF : 1110xxxx 10xxxxxx 10xxxxxx
35
// 10000 - 10FFFF : 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
36
//
37
// Values greater than 0x10FFFF are not supported and may or may not write
38
// characters into buffer, however never will more than kMaxEncodedUTF8Size
39
// bytes be written, regardless of the value of utf8_char.
40
enum
{
kMaxEncodedUTF8Size
= 4 };
41
size_t
EncodeUTF8Char
(
char
*buffer, char32_t utf8_char);
42
43
}
// namespace strings_internal
44
}
// namespace absl
45
46
#endif // ABSL_STRINGS_INTERNAL_UTF8_H_
absl
Definition:
algorithm.h:29
absl::strings_internal::EncodeUTF8Char
size_t EncodeUTF8Char(char *buffer, char32_t utf8_char)
Definition:
utf8.cc:22
absl::strings_internal::kMaxEncodedUTF8Size
Definition:
utf8.h:40
abseil_cpp
Author(s):
autogenerated on Mon Feb 28 2022 21:31:21