mirror of
https://github.com/DanielSWolf/rhubarb-lip-sync.git
synced 2026-11-21 12:25:08 +00:00
Restored dialog option, this time based on language model
This approach should be more robust and error-tolerant.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "stringTools.h"
|
||||
#include <boost/algorithm/string/trim.hpp>
|
||||
#include <codecvt>
|
||||
|
||||
using std::string;
|
||||
using std::wstring;
|
||||
@@ -106,3 +107,12 @@ string toASCII(const u32string& s) {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
u32string utf8ToUtf32(const string& s) {
|
||||
// Visual Studio 2015 has a bug regarding char32_t:
|
||||
// https://connect.microsoft.com/VisualStudio/feedback/details/1403302/unresolved-external-when-using-codecvt-utf8
|
||||
// Once VS2016 is out, we can use char32_t instead of uint32_t as type arguments and get rid of the outer conversion.
|
||||
|
||||
std::wstring_convert<std::codecvt_utf8<uint32_t>, uint32_t> convert;
|
||||
return u32string(reinterpret_cast<const char32_t*>(convert.from_bytes(s).c_str()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user