simon-git: putty (main): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Tue May 31 13:23:49 BST 2022
TL;DR:
a216d861 Windows mb_to_wc: support internal SBCSes.
Repository: https://git.tartarus.org/simon/putty.git
On the web: https://git.tartarus.org/?p=simon/putty.git
Branch updated: main
Committer: Simon Tatham <anakin at pobox.com>
Date: 2022-05-31 13:23:49
commit a216d86106d40c38f05f1ffc03996be54d590aa6
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=a216d86106d40c38f05f1ffc03996be54d590aa6;hp=eb7f5aff5c2234296b9ec69675e02aefa6bb773d
Author: Simon Tatham <anakin at pobox.com>
Date: Tue May 31 13:13:57 2022 +0100
Windows mb_to_wc: support internal SBCSes.
A user points out that the new charset-aware window title setting
doesn't work if the configured character set is one of the entries in
cp_list[] based on a hard-coded Unicode translation table, such as the
ISO 8859 family.
That's because the Windows mb_to_wc() function assumes that the code
page it's given will always be OK to pass to the Windows API function
MultiByteToWideChar, forgetting that for those internally implemented
single-byte character sets are not.
This commit adds a manual implementation of SBCS -> Unicode based on
those tables, which restores the ability to set a window title
specified in ISO 8859.
However, it's not a full fix to windows/unicode.c in general, because
wc_to_mb has a similar blind spot: it's only prepared to convert
Unicode to an internally implemented SBCS if that SBCS happens to be
the one currently set in ucsdata->line_codepage, because that's when
we've already prepared the reverse lookup table. Probably we ought to
sort that out, and arrange that it can make the reverse lookup table
if suddenly called on to do a different conversion. But that needs
more refactoring, so I haven't done it in this commit.
windows/unicode.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
More information about the tartarus-commits
mailing list