mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-19 12:41:37 +00:00
Merge branch 'use_std_locale' into 'master'
make use of std::wstring_convert to replace boost::locale::conv::utf_to_utf See merge request OpenMW/openmw!2969
This commit is contained in:
commit
c752c8950f
1 changed files with 5 additions and 4 deletions
|
@ -18,7 +18,8 @@ int main(int argc, char* argv[])
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// Include on Windows only
|
// Include on Windows only
|
||||||
#include <boost/locale.hpp>
|
#include <codecvt>
|
||||||
|
#include <locale>
|
||||||
|
|
||||||
class utf8argv
|
class utf8argv
|
||||||
{
|
{
|
||||||
|
@ -28,9 +29,11 @@ public:
|
||||||
args.reserve(argc);
|
args.reserve(argc);
|
||||||
argv = new const char*[argc];
|
argv = new const char*[argc];
|
||||||
|
|
||||||
|
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
|
||||||
|
|
||||||
for (int i = 0; i < argc; ++i)
|
for (int i = 0; i < argc; ++i)
|
||||||
{
|
{
|
||||||
args.push_back(boost::locale::conv::utf_to_utf<char>(wargv[i]));
|
args.push_back(converter.to_bytes(wargv[i]));
|
||||||
argv[i] = args.back().c_str();
|
argv[i] = args.back().c_str();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,8 +53,6 @@ private:
|
||||||
characters interface which presents UTF-16 encoding. The rest of
|
characters interface which presents UTF-16 encoding. The rest of
|
||||||
OpenMW application stack assumes UTF-8 encoding, therefore this
|
OpenMW application stack assumes UTF-8 encoding, therefore this
|
||||||
conversion.
|
conversion.
|
||||||
|
|
||||||
For boost::filesystem::path::imbue see components/files/windowspath.cpp
|
|
||||||
*/
|
*/
|
||||||
int wmain(int argc, wchar_t* wargv[])
|
int wmain(int argc, wchar_t* wargv[])
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue