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

Implement Unicode normalisation.

A new module in 'utils' computes NFC and NFD, via a new set of data
tables generated by read_ucd.py.

The new module comes with a new test program, which can read the
NormalizationTest.txt that appears in the Unicode Character Database.
All the tests pass, as of Unicode 15.
This commit is contained in:
Simon Tatham
2022-11-09 19:28:51 +00:00
parent 4cb429e3f4
commit b35d23f699
8 changed files with 3984 additions and 9 deletions

3
misc.h
View File

@ -265,6 +265,9 @@ unsigned decode_utf8(BinarySource *src);
* number written. */
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);
/* Write a string out in C string-literal format. */
void write_c_string_literal(FILE *fp, ptrlen str);