mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-20 18:48:08 +08:00
14
src/ftxui/screen/string.cpp
Normal file
14
src/ftxui/screen/string.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "ftxui/screen/string.hpp"
|
||||
|
||||
#include <codecvt>
|
||||
#include <locale>
|
||||
|
||||
std::string to_string(const std::wstring& s) {
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
|
||||
return converter.to_bytes(s);
|
||||
}
|
||||
|
||||
std::wstring to_wstring(const std::string& s) {
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
|
||||
return converter.from_bytes(s);
|
||||
}
|
Reference in New Issue
Block a user