File: encode_utf16.h

package info (click to toggle)
simdutf 7.7.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,244 kB
  • sloc: cpp: 60,074; ansic: 14,226; python: 3,364; sh: 321; makefile: 12
file content (20 lines) | stat: -rw-r--r-- 487 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once

#include <cstdint>

namespace simdutf {
namespace tests {
namespace reference {
namespace utf16 {

// returns whether the value can be represented in the UTF-16
bool valid_value(uint32_t value);

// Encodes the value using either one or two code units (returns 1 or 2
// respectively) Returns 0 if the value cannot be encoded
int encode(uint32_t value, char16_t &W1, char16_t &W2);

} // namespace utf16
} // namespace reference
} // namespace tests
} // namespace simdutf