UTF8
#include <tpau-cpp-kernal/UTF8.h>
INCLUDE FILE
#include <tpau-cpp-kernal/UTF8.h>
class UTF8
Utility functions for working with UTF-8 and Unicode code-points.
DEFINITION
class UTF8;
method decodestatic
Decodes a UTF-8 string into a sequence of Unicode code-points.
DEFINITION
| static std::u32string decode | ( | const std::string & string | ); |
| PARAMETER | DESCRIPTION |
|---|---|
string |
The UTF-8 string to decode. |
| RETURNS | DESCRIPTION |
|---|---|
std::u32string |
A sequence of Unicode code-points. |
method encodestatic
Encodes a Unicode code-point into a UTF-8 string.
DEFINITION
| static std::string encode | ( | char32_t codepoint, | |
| bool escape_non_printable = false | ); |
| PARAMETER | DESCRIPTION |
|---|---|
codepoint |
The Unicode code-point to encode. |
escape_non_printable |
If true, non-printable characters will be escaped as |
| RETURNS | DESCRIPTION |
|---|---|
std::string |
The UTF-8 encoded string. |
method encodestatic
Encodes a sequence of Unicode code-points into a UTF-8 string.
DEFINITION
| static std::string encode | ( | const std::u32string & string | ); |
| PARAMETER | DESCRIPTION |
|---|---|
string |
The sequence of Unicode code-points to encode. |
| RETURNS | DESCRIPTION |
|---|---|
std::string |
The UTF-8 encoded string. |
method is_printablestatic
Checks if a Unicode code-point is printable.
DEFINITION
| static bool is_printable | ( | char32_t codepoint | ); |
| PARAMETER | DESCRIPTION |
|---|---|
codepoint |
The Unicode code-point to check. |
| RETURNS | DESCRIPTION |
|---|---|
bool |
True if the code-point is printable, false otherwise. |