diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-08-09 02:00:18 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-08-17 12:59:25 +0200 |
| commit | 199f9e9026861d1a104f2b24371ddbb94f0e8169 (patch) | |
| tree | 5757bca98c790e5b385d4bdb9b6d09d783571945 | |
| parent | 37fa3bccbed52516b584c92f461d0050f3486158 (diff) | |
Add new char_to_wx() to convert UTF8 character arrays to wxString.
| -rw-r--r-- | src/wx/wx_util.cc | 7 | ||||
| -rw-r--r-- | src/wx/wx_util.h | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 1c04a4755..f3d75a462 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -214,6 +214,13 @@ std_to_wx (string s) } +wxString +char_to_wx(char const* s) +{ + return wxString::FromUTF8(s); +} + + string string_client_data (wxClientData* o) { diff --git a/src/wx/wx_util.h b/src/wx/wx_util.h index 04d43e38d..51a46d307 100644 --- a/src/wx/wx_util.h +++ b/src/wx/wx_util.h @@ -105,6 +105,10 @@ extern wxStaticText* add_label_to_sizer(wxGridBagSizer *, wxWindow *, wxString, extern wxStaticText* add_label_to_sizer (wxGridBagSizer *, wxStaticText *, bool, wxGBPosition, wxGBSpan span = wxDefaultSpan); extern std::string wx_to_std (wxString); extern wxString std_to_wx (std::string); + +/** Convert UTF8-encoded char array to wxString */ +extern wxString char_to_wx(char const* s); + extern void dcpomatic_setup_i18n (); extern wxString context_translation (wxString); extern std::string string_client_data (wxClientData* o); |
