[MOD/WIP] Manage some codepoints on XML

This commit is contained in:
LDA 2024-07-24 18:46:03 +02:00
commit cc2d53d9e9

View file

@ -7,6 +7,7 @@
#include <Cytoplasm/Log.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
struct XMLexer {
@ -637,6 +638,22 @@ XMLDecodeString(char *s)
cs[0] = '&';
s += 5;
}
else if (!strncmp(s, "&#", 2))
{
char *dec = s + 2;
char *end = strchr(dec, ';');
if (!end)
{
s++;
}
else
{
/* TODO: Decode any Unicode glyph as UTF-8. */
int val = strtol(dec, &end, 10);
cs[0] = val;
s = end + 1;
}
}
else
{
s++;