mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-12-21 11:30:38 +00:00
Added a wrapper for U16toU8, called AUTOU16TOU8
- U16toU8 now requires a max arument to be passed
This commit is contained in:
@@ -148,7 +148,8 @@ int main() {
|
||||
|
||||
// helper functions
|
||||
|
||||
std::string U16toU8(char16_t* src) {
|
||||
std::string U16toU8(char16_t* src, size_t max) {
|
||||
src[max-1] = '\0'; // force a NULL terminatorstd::string U16toU8(char16_t* src) {
|
||||
try {
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>,char16_t> convert;
|
||||
return convert.to_bytes(src);
|
||||
|
||||
Reference in New Issue
Block a user