simdutf
8.0.0
Unicode at GB/s.
Loading...
Searching...
No Matches
latin1.h
1
#ifndef SIMDUTF_LATIN1_H
2
#define SIMDUTF_LATIN1_H
3
4
namespace
simdutf {
5
namespace
scalar {
6
namespace
{
7
namespace
latin1 {
8
9
simdutf_really_inline
size_t
utf8_length_from_latin1(
const
char
*buf,
10
size_t
len) {
11
const
uint8_t *c =
reinterpret_cast<
const
uint8_t *
>
(buf);
12
size_t
answer = 0;
13
for
(
size_t
i = 0; i < len; i++) {
14
if
((c[i] >> 7)) {
15
answer++;
16
}
17
}
18
return
answer + len;
19
}
20
21
}
// namespace latin1
22
}
// unnamed namespace
23
}
// namespace scalar
24
}
// namespace simdutf
25
26
#endif
include
simdutf
scalar
latin1.h
Generated by
1.9.8