Skip to content

Commit

Permalink
Revert changes to to_wx
Browse files Browse the repository at this point in the history
These broke some things, in particular FromUTF8Unchecked seems to not
like empty strings. Probably safer to just revert.
  • Loading branch information
arch1t3cht committed Dec 1, 2023
1 parent ab34aee commit 22eb866
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/compat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ wxColour to_wx(agi::Color color) {
}

wxString to_wx(std::string const& str) {
return wxString::FromUTF8Unchecked(str.c_str());
return wxString(str.c_str(), wxConvUTF8);
}

wxString to_wx(std::string_view str) {
return wxString::FromUTF8Unchecked(str.data(), str.size());
return wxString(str.data(), wxConvUTF8, str.size());
}

wxString to_wx(const char *str) {
return wxString::FromUTF8Unchecked(str);
return wxString(str, wxConvUTF8);
}

agi::Color from_wx(wxColour color) {
Expand Down

0 comments on commit 22eb866

Please sign in to comment.