1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-18 11:31:00 -05:00

Function to check a UTF-8 string for unknown characters.

So we can reject things we don't know how to NFC yet.
This commit is contained in:
Simon Tatham
2022-11-09 08:56:11 +00:00
parent b35d23f699
commit d3e186e81b
5 changed files with 790 additions and 0 deletions

4
misc.h
View File

@ -268,6 +268,10 @@ size_t decode_utf8_to_wchar(BinarySource *src, wchar_t *out);
/* Normalise a UTF-8 string into Normalisation Form C. */
strbuf *utf8_to_nfc(ptrlen input);
/* Determine if a UTF-8 string contains any characters unknown to our
* supported version of Unicode. */
char *utf8_unknown_char(ptrlen input);
/* Write a string out in C string-literal format. */
void write_c_string_literal(FILE *fp, ptrlen str);