1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-07 06:22:47 -05:00

Factor out encode_utf8 from luni_send into utils.c.

I knew there had to already be a UTF-8 encoder _somewhere_ in this
code base, but it took me a while to find it! Now it's reusable in
other contexts.
This commit is contained in:
Simon Tatham
2019-03-05 07:24:17 +00:00
parent 0dcdb1b5a3
commit 511eea450a
3 changed files with 28 additions and 15 deletions

5
misc.h
View File

@ -199,6 +199,11 @@ void smemclr(void *b, size_t len);
* hinted at by the 'eq' in the name. */
bool smemeq(const void *av, const void *bv, size_t len);
/* Encode a single UTF-8 character. Assumes that illegal characters
* (such as things in the surrogate range, or > 0x10FFFF) have already
* been removed. */
size_t encode_utf8(void *output, unsigned long ch);
char *buildinfo(const char *newline);
/*