载入中...
搜索中...
未找到
utf8.h
浏览该文件的文档.
1
2#include "common/config.h"
3
4#include <cstddef>
5#include <string>
6
7#ifdef EVENGINE_WINDOWS
8#define NOMINMAX
9#include <windows.h>
10#endif
11
12namespace eve
13{
14
19size_t utf8_codepoint_count(const std::string &s);
20
25size_t utf8_byte_offset_for_codepoints(const std::string &s, size_t codepoints);
26
27#ifdef EVENGINE_WINDOWS
28
34std::string to_utf8(LPCWSTR wstr);
35
41std::wstring to_widestr(const std::string &str);
42
49void replace_char(std::string &str, char find, char replace);
50
51#endif // EVENGINE_WINDOWS
52
53} // eve
uint32_t s
Definition Weather.cpp:28
Definition Build.cpp:11
size_t utf8_codepoint_count(const std::string &s)
Count UTF-8 code points in a string. Invalid / truncated sequences stop the scan.
Definition utf8.cpp:23
size_t utf8_byte_offset_for_codepoints(const std::string &s, size_t codepoints)
Byte offset of the N-th UTF-8 code point (0-based count of code points). Returns s....
Definition utf8.cpp:37