NSUNI/NSLAR Library a250670
Loading...
Searching...
No Matches
utf8.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include <string>
9#include <string_view>
10
11namespace nnl {
16namespace utl::utf8 {
17
23bool IsValid(std::string_view str);
30std::size_t GetSize(std::string_view str, std::size_t pos = 0);
31
38char32_t Decode(std::string_view str, std::size_t pos = 0);
39
45std::string Encode(char32_t codepoint);
52bool IsRightToLeft(char32_t codepoint);
58bool IsASCII(std::string_view str);
59} // namespace utl::utf8
60} // namespace nnl
Provides utilities for working with the UTF-8 encoding.
Definition utf8.hpp:16
std::string Encode(char32_t codepoint)
Encodes Unicode code point to UTF-8.
bool IsASCII(std::string_view str)
Checks if a string contains only characters from the basic ASCII set.
char32_t Decode(std::string_view str, std::size_t pos=0)
Decodes UTF-8 character to Unicode code point.
bool IsValid(std::string_view str)
Checks if string contains valid UTF-8 encoding.
std::size_t GetSize(std::string_view str, std::size_t pos=0)
Gets size of UTF-8 character at position.
bool IsRightToLeft(char32_t codepoint)
Checks if a Unicode code point belongs to a right-to-left script or has RTL directionality.
Definition exception.hpp:56