summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-08-09 02:00:18 +0200
committerCarl Hetherington <cth@carlh.net>2024-09-03 17:02:24 +0200
commita27964bd1794bb6a843873a0eaf3faa2c5cc317a (patch)
tree036182f31334e0d5d67c2a86fb2f0221f36f23e4
parentf3ab77e34a41ad4d8f5156e9d6598314975b9565 (diff)
Add new char_to_wx() to convert UTF8 character arrays to wxString.
-rw-r--r--src/wx/wx_util.cc7
-rw-r--r--src/wx/wx_util.h4
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);