checks-parser/utils/utils.cpp

16 lines
401 B
C++
Raw Normal View History

#include "utils.h"
#include <codecvt>
#include <string>
#include <locale>
std::string to_utf8(std::wstring wide_string) {
static std::wstring_convert<std::codecvt_utf8<wchar_t>> utf8_conv;
return utf8_conv.to_bytes(wide_string);
}
std::wstring from_utf8(std::string string) {
static std::wstring_convert<std::codecvt_utf8<wchar_t>> utf8_conv;
return utf8_conv.from_bytes(string);
}