45size_t Sub(std::string_view str,
size_t max);
54void Copy(
char* target,
size_t size, std::string_view source,
bool show_log =
true);
68std::string
Utf8ToMultiByte(std::string_view str, std::string_view code_page =
"");
83std::string
MultiByteToUtf8(std::string_view str, std::string_view code_page =
"");
int Check(std::string_view str)
返回是否是utf-8编码
size_t Sub(std::string_view str, size_t max)
utf-8的子串计算
void Copy(char *target, size_t size, std::string_view source, bool show_log=true)
utf-8的安全复制
std::string WideCharToUtf8(std::wstring_view str)
字符串转换:宽字符 -> utf8
std::wstring Utf8ToWideChar(std::string_view str)
字符串转换:utf8 -> 宽字符
constexpr size_t SIZE_BUFFER_STRING_CONVERT
编码转换缓冲区大小,越大使用更多的内存,但会更快
Buffer CvtString(std::string_view from, std::string_view to, BufferView buf)
iconv的简单封装,请使用更具体的函数。
std::string MultiByteToUtf8(std::string_view str, std::string_view code_page="")
字符串转换:本地编码 -> utf8
std::string Utf32ToUtf8(std::u32string_view str)
字符串转换:utf32 -> utf8
std::u32string Utf8ToUtf32(std::string_view str)
字符串转换:utf8 -> utf32
std::string Utf8ToMultiByte(std::string_view str, std::string_view code_page="")
字符串转换:utf8 -> 本地编码