Skip to content

Commit

Permalink
Fixed conversion between utf-8 and utf-16 for Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
thunder2 authored and ni4 committed Dec 24, 2024
1 parent cd9ca84 commit ec78117
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/common/str-utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,14 @@ is_slash(char c)
std::wstring
wstr_from_utf8(const char *s)
{
std::wstring_convert<std::codecvt_utf8<wchar_t>> utf8conv;
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> utf8conv;
return utf8conv.from_bytes(s);
}

std::wstring
wstr_from_utf8(const char *first, const char *last)
{
std::wstring_convert<std::codecvt_utf8<wchar_t>> utf8conv;
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> utf8conv;
return utf8conv.from_bytes(first, last);
}

Expand All @@ -205,7 +205,7 @@ wstr_from_utf8(const std::string &s)
std::string
wstr_to_utf8(const wchar_t *ws)
{
std::wstring_convert<std::codecvt_utf8<wchar_t>> utf8conv;
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> utf8conv;
return utf8conv.to_bytes(ws);
}

Expand Down

0 comments on commit ec78117

Please sign in to comment.