Fix Unicode handling in Json, don't sign-extend bytes in Stream.

This commit is contained in:
Jordan Bancino 2023-07-15 17:57:21 +00:00
parent e557de8d9d
commit c4121d2dba
4 changed files with 88 additions and 23 deletions

View file

@ -39,14 +39,21 @@
* is a standard library header.
*/
#include <Int.h>
#include <stddef.h>
/**
* Take a UTF-8 codepoint and encode it into a string buffer containing
* Convert UTF-16 into a Unicode codepoint.
*/
extern UInt32 StrUtf16Decode(UInt16, UInt16);
/**
* Take a Unicode codepoint and encode it into a string buffer containing
* between 1 and 4 bytes. The string buffer is allocated on the heap,
* so it should be freed when it is no longer needed.
*/
extern char * StrUtf8Encode(unsigned long);
extern char * StrUtf8Encode(UInt32);
/**
* Duplicate a null-terminated string, returning a new string on the