mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-12-24 02:11:03 +00:00
use wstring_convert (but is deprecated in c++17)
This commit is contained in:
parent
5ffc51a99d
commit
1fc58095fa
@ -1074,7 +1074,13 @@ toml::Table parse(std::basic_istream<wchar_t, traits>& is)
|
||||
std::vector<wchar_t> contents(size);
|
||||
is.read(contents.data(), size);
|
||||
is.imbue(curloc);
|
||||
return parse_data::invoke(contents.cbegin(), contents.cend());
|
||||
|
||||
std::wstring wstr(size, ' ');
|
||||
std::copy(contents.cbegin(), contents.cend(), wstr.begin());
|
||||
std::wstring_convert<std::convert_utf8<wchar_t>, wchar_t> cvter;
|
||||
std::string u8str = converter.to_bytes(wstr);
|
||||
|
||||
return parse_data::invoke(u8str.cbegin(), u8str.cend());
|
||||
}
|
||||
|
||||
toml::Table parse(const std::string& filename)
|
||||
|
Loading…
Reference in New Issue
Block a user