1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 09:27:59 +00:00
putty-source/utils
Simon Tatham 75b6e12f84 Add two new string types to the Conf system.
This begins the process of making PuTTY more able to handle Unicode
strings as a first-class type in its configuration. One of the new
types, CONF_TYPE_UTF8, looks physically just like CONF_TYPE_STR but
the semantics are that it's definitely encoded in UTF-8, instead of
'shrug, whatever the system locale's encoding is'.

Unfortunately, we can't yet switch over any Conf items to having that
type, because our data representations in saved configuration (both on
Unix and Windows) store char strings in the system encoding. So we'll
have to change that representation at the same time, which risks
breaking backwards compatibility with old PuTTYs reading the same
configuration.

So the other new type, CONF_TYPE_STR_AMBI, is intended as a
transitional form, recording a configuration setting that _might_ be
explicitly UTF-8 or might have the legacy 'shrug, whatever' semantics,
depending on where we got it from.

My general migration plan is that first I _enable_ Unicode support in
a Conf item, by turning it into STR_AMBI; the Unicode version of the
string (if any) is saved in a new location, and a best-effort
local-charset version is saved where it's always been. That way new
PuTTY can read the Unicode version, and old PuTTY reading that
configuration will behave no worse than it would have done already.

It would be nice to think that in the far future we've migrated
everything to STR_AMBI and can move them all to mandatory UTF-8,
obsoleting the old configuration. I think it's more likely we'll never
get there. But at least _new_ Conf items, with no backwards
compatibility requirement in the first place, can be CONF_TYPE_UTF8
where appropriate.

(In conf_get_str_ambi(), I considered making it mandatory via assert()
to pass the 'utf8' output pointer as non-NULL, to defend against lazy
adaptation of existing code by just changing the function call. But in
fact I think there's a legitimate use case for not caring if the
output is UTF-8 or not, because some of the existing SSH code
currently just shoves strings like usernames directly on to the wire
whether they're in the right encoding or not; so if you want to do the
correct UTF-8 thing where possible and preserve legacy behaviour if
not, then treating both classes of string the same _is_ the right
thing to do.)

This also requires linking the Unicode support into many Unix
applications that hadn't previously needed it.
2024-09-26 11:30:07 +01:00
..
antispoof.c Marshalling macros put_dataz and put_datalit. 2021-11-19 15:09:17 +00:00
backend_socket_log.c Log outgoing address + port numbers in the Event Log. 2024-06-29 12:18:28 +01:00
base64_decode_atom.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
base64_decode.c Improve the base64 utility functions. 2022-04-25 14:10:16 +01:00
base64_encode_atom.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
base64_encode.c Improve the base64 utility functions. 2022-04-25 14:10:16 +01:00
base64_valid.c New utility function base64_valid(). 2022-05-01 11:27:37 +01:00
bufchain.c Add some more bufchain_try_* functions. 2021-11-19 10:35:38 +00:00
buildinfo.c buildinfo.c: add another Visual Studio version. 2022-09-06 11:39:01 +01:00
burnstr.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
burnwcs.c New utility function burnwcs(). 2022-11-26 10:32:36 +00:00
cert-expr.c Document subdomain matching of cert expr wildcards. 2022-10-22 01:22:10 +01:00
chomp.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
CMakeLists.txt Stringify all the CONF_foo identifiers, for debugging. 2024-09-23 16:49:29 +01:00
cmdline_get_passwd_input_state_new.c Fix command-line password handling in Restart Session. 2022-05-18 13:05:17 +01:00
conf_data.c Add ability to specify custom load and save separately. 2023-09-22 16:23:37 +01:00
conf_debug.c Stringify all the CONF_foo identifiers, for debugging. 2024-09-23 16:49:29 +01:00
conf_dest.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
conf_launchable.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
conf.c Add two new string types to the Conf system. 2024-09-26 11:30:07 +01:00
ctrlparse.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
ctrlset_normalise.c Make HelpCtx a per-platform type, not an intorptr. 2022-07-07 17:34:24 +01:00
debug.c Formatting: realign run-on parenthesised stuff. 2022-08-03 20:48:46 +01:00
decode_utf8_to_wchar.c decode_utf8: add an enumeration of failure reasons. 2023-02-17 17:16:54 +00:00
decode_utf8_to_wide_string.c New utility function: decode_utf8_to_wide_string. 2023-05-29 15:08:49 +01:00
decode_utf8.c decode_utf8: add an enumeration of failure reasons. 2023-02-17 17:16:54 +00:00
default_description.c Add 'description' methods for Backend and Plug. 2021-10-24 10:48:25 +01:00
dup_mb_to_wc.c Rework Unicode conversion APIs to use a BinarySink. 2024-09-26 11:30:07 +01:00
dup_wc_to_mb.c Rework Unicode conversion APIs to use a BinarySink. 2024-09-26 11:30:07 +01:00
dupcat.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
dupprintf.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
dupstr.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
dupwcs.c New utility function: dupwcs. 2023-05-29 15:08:49 +01:00
encode_utf8.c Make encode_utf8() output to a BinarySink. 2022-11-09 19:02:32 +00:00
encode_wide_string_as_utf8.c Make encode_utf8() output to a BinarySink. 2022-11-09 19:02:32 +00:00
fgetline.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
host_ca_new_free.c Certificate trust scope: change to a boolean-expression system. 2022-06-25 14:32:23 +01:00
host_strchr_internal.c Build various unit-test main() programs in utils. 2021-04-18 08:30:44 +01:00
host_strchr.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
host_strcspn.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
host_strduptrim.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
host_strrchr.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
key_components.c Extra helper functions for adding key_components. 2022-04-24 08:39:04 +01:00
log_proxy_stderr.c Pass the calling Socket to plug_log. 2024-06-29 12:00:12 +01:00
logeventf.c Move the logeventf wrappers into their own source file. 2023-02-18 14:11:31 +00:00
ltime.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
make_spr_sw_abort_static.c Richer data type for interactive prompt results. 2021-12-28 18:08:31 +00:00
marshal.c Implement a BinarySink writing to a fixed-size buffer. 2022-11-09 19:00:04 +00:00
memory.c Side-channel tester: align memory allocations. 2024-04-01 13:10:49 +01:00
memxor.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
nullstrcmp.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
out_of_memory.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
parse_blocksize.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
percent_decode.c Routines for %-encoding and %-decoding. 2022-06-25 14:30:39 +01:00
percent_encode.c Routines for %-encoding and %-decoding. 2022-06-25 14:30:39 +01:00
prompts.c Add UTF-8 support to the new Windows ConsoleIO system. 2022-11-26 10:49:03 +00:00
ptrlen.c A few more ptrlen functions. 2022-06-25 14:30:39 +01:00
read_file_into.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
seat_connection_fatal.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
seat_dialog_text.c Centralise most details of host-key prompting. 2022-07-07 18:05:32 +01:00
seat_nonfatal.c New Seat method, seat_nonfatal(). 2022-09-13 11:26:57 +01:00
sessprep.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
sk_free_peer_info.c Rename SocketPeerInfo to SocketEndpointInfo. 2024-06-29 11:49:32 +01:00
smemclr.c Fix typo in comment. 2021-04-19 17:14:01 +01:00
smemeq.c Make smemeq return unsigned, not bool. 2022-04-15 17:46:06 +01:00
spr_get_error_message.c Richer data type for interactive prompt results. 2021-12-28 18:08:31 +00:00
ssh2_pick_fingerprint.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
ssh_key_clone.c Utility function ssh_key_clone(). 2022-04-24 08:39:04 +01:00
sshutils.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
strbuf.c Utility function strbuf_dup. 2022-04-24 08:38:27 +01:00
string_length_for_printf.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
stripctrl.c Make encode_utf8() output to a BinarySink. 2022-11-09 19:02:32 +00:00
tempseat.c Merge tag '0.80'. 2023-12-18 14:47:48 +00:00
tree234.c Rename 'ret' variables passed from allocation to return. 2022-09-14 16:10:29 +01:00
unicode-known.c decode_utf8: add an enumeration of failure reasons. 2023-02-17 17:16:54 +00:00
unicode-norm.c decode_utf8: add an enumeration of failure reasons. 2023-02-17 17:16:54 +00:00
utils.h New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
validate_manual_hostkey.c Add some missing casts in ctype functions. 2023-04-19 14:28:36 +01:00
version.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
wcwidth.c Commit read_ucd.py's output and switch over to it. 2022-11-11 08:44:07 +00:00
wildcard.c Build various unit-test main() programs in utils. 2021-04-18 08:30:44 +01:00
wordwrap.c Utility function to do terminal word wrapping. 2022-07-07 18:05:32 +01:00
write_c_string_literal.c Remove duplicated string-literal formatter in Telnet proxy. 2021-12-22 15:05:04 +00:00
x11_dehexify.c Add some missing #includes. 2022-09-03 11:59:12 +01:00
x11_identify_auth_proto.c Add some missing #includes. 2022-09-03 11:59:12 +01:00
x11_make_greeting.c Break up x11fwd.c. 2021-04-18 08:18:27 +01:00
x11_parse_ip.c Add some missing #includes. 2022-09-03 11:59:12 +01:00
x11authfile.c Make x11_get_auth_from_authfile take a Filename. 2023-05-29 15:41:50 +01:00
x11authnames.c Break up x11fwd.c. 2021-04-18 08:18:27 +01:00