simdutf 8.0.0
Unicode at GB/s.
Loading...
Searching...
No Matches
latin1_to_utf32.h
1#ifndef SIMDUTF_LATIN1_TO_UTF32_H
2#define SIMDUTF_LATIN1_TO_UTF32_H
3
4namespace simdutf {
5namespace scalar {
6namespace {
7namespace latin1_to_utf32 {
8
9template <typename InputPtr>
10#if SIMDUTF_CPLUSPLUS20
11 requires simdutf::detail::indexes_into_byte_like<InputPtr>
12#endif
13simdutf_constexpr23 size_t convert(InputPtr data, size_t len,
14 char32_t *utf32_output) {
15 char32_t *start{utf32_output};
16 for (size_t i = 0; i < len; i++) {
17 *utf32_output++ = uint8_t(data[i]);
18 }
19 return utf32_output - start;
20}
21
22} // namespace latin1_to_utf32
23} // unnamed namespace
24} // namespace scalar
25} // namespace simdutf
26
27#endif