unicode : try fix windows
This commit is contained in:
parent
91eaa414bf
commit
581c4a0239
1 changed files with 5 additions and 0 deletions
|
@ -203,8 +203,13 @@ static inline std::wstring unicode_wstring_from_utf8(const std::string & s) {
|
|||
}
|
||||
|
||||
static inline std::string unicode_wstring_to_utf8(const std::wstring & ws) {
|
||||
#if defined(_MSC_VER)
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t> converter;
|
||||
return converter.to_bytes(ws);
|
||||
#else
|
||||
std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
|
||||
return conv.to_bytes(ws);
|
||||
#endif
|
||||
}
|
||||
|
||||
static std::vector<std::string> unicode_byte_encoding_process(const std::vector<std::string> & bpe_words) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue