Output to csv, started work on OFD module
This commit is contained in:
15
utils/utils.cpp
Normal file
15
utils/utils.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#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);
|
||||
}
|
||||
9
utils/utils.h
Normal file
9
utils/utils.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
|
||||
#include <string>
|
||||
|
||||
std::string to_utf8(std::wstring wide_string);
|
||||
std::wstring from_utf8(std::string string);
|
||||
|
||||
#endif // UTILS_H
|
||||
Reference in New Issue
Block a user