FTSLib
0.1.1
A simple C++ library for decoding FTS (FloweyTaleSave) files.
Loading...
Searching...
No Matches
fts
utf8.hpp
Go to the documentation of this file.
1
#ifndef UTF8_HPP
2
#define UTF8_HPP
3
4
#include <codecvt>
5
#include <string>
6
#include <locale>
7
8
inline
char32_t
chtocp
(std::string character) {
9
std::wstring_convert<std::codecvt_utf8<char32_t>,
char32_t
> converter;
10
return
converter.from_bytes(character)[0];
11
}
12
13
inline
std::string
cptoch
(
char32_t
codepoint) {
14
std::wstring_convert<std::codecvt_utf8<char32_t>,
char32_t
> converter;
15
return
converter.to_bytes(&codepoint, &codepoint + 1);
16
}
17
18
#endif
chtocp
char32_t chtocp(std::string character)
Definition
utf8.hpp:8
cptoch
std::string cptoch(char32_t codepoint)
Definition
utf8.hpp:13
Generated by
1.10.0