1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -05:00

dup_mb_to_wc, dup_wc_to_mb: remove the 'flags' parameter.

This parameter was undocumented, and Windows-specific: its semantics
date from before PuTTY was cross-platform, and are "Pass this flags
parameter straight through to the Win32 API's conversion functions".
So in Windows platform code you can pass flags like MB_USEGLYPHCHARS,
but in cross-platform code, you dare not pass anything nonzero at all
because the Unix frontend won't recognise it (or, likely, even
compile).

I've kept the flag for now in the underlying mb_to_wc / wc_to_mb
functions. Partly that's because there's one place in the Windows code
where the parameter _is_ used; mostly, it's because I'm about to
replace those functions anyway, so there's no point in editing all the
call sites twice.
This commit is contained in:
Simon Tatham
2024-09-24 08:46:39 +01:00
parent ed621590b0
commit c4c4d2c5cb
10 changed files with 31 additions and 32 deletions

View File

@ -3440,7 +3440,7 @@ static void gtkwin_set_title(TermWin *tw, const char *title, int codepage)
GtkFrontend *inst = container_of(tw, GtkFrontend, termwin);
sfree(inst->wintitle);
if (codepage != CP_UTF8) {
wchar_t *title_w = dup_mb_to_wc(codepage, 0, title);
wchar_t *title_w = dup_mb_to_wc(codepage, title);
inst->wintitle = encode_wide_string_as_utf8(title_w);
sfree(title_w);
} else {
@ -3454,7 +3454,7 @@ static void gtkwin_set_icon_title(TermWin *tw, const char *title, int codepage)
GtkFrontend *inst = container_of(tw, GtkFrontend, termwin);
sfree(inst->icontitle);
if (codepage != CP_UTF8) {
wchar_t *title_w = dup_mb_to_wc(codepage, 0, title);
wchar_t *title_w = dup_mb_to_wc(codepage, title);
inst->icontitle = encode_wide_string_as_utf8(title_w);
sfree(title_w);
} else {