1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-19 03:51:02 -05:00

Add UTF-8 versions of dlg_editbox_{get,set}.

There's no difficulty with implementing these, on either platform.
Windows has native Unicode support for its edit boxes: we can set and
retrieve the text as a wide-character string, and then converting it
to and from UTF-8 is easy. And GTK has specified its edit boxes as
being UTF-8 all along, no matter what the system locale.
This commit is contained in:
Simon Tatham
2024-09-23 14:20:44 +01:00
parent 75b6e12f84
commit 55d413a47a
3 changed files with 37 additions and 2 deletions

View File

@ -574,7 +574,9 @@ int dlg_radiobutton_get(dlgcontrol *ctrl, dlgparam *dp);
void dlg_checkbox_set(dlgcontrol *ctrl, dlgparam *dp, bool checked);
bool dlg_checkbox_get(dlgcontrol *ctrl, dlgparam *dp);
void dlg_editbox_set(dlgcontrol *ctrl, dlgparam *dp, char const *text);
void dlg_editbox_set_utf8(dlgcontrol *ctrl, dlgparam *dp, char const *text);
char *dlg_editbox_get(dlgcontrol *ctrl, dlgparam *dp); /* result must be freed by caller */
char *dlg_editbox_get_utf8(dlgcontrol *ctrl, dlgparam *dp); /* result must be freed by caller */
void dlg_editbox_select_range(dlgcontrol *ctrl, dlgparam *dp,
size_t start, size_t len);
/* The `listbox' functions can also apply to combo boxes. */