mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 21:35:10 +00:00
[MOD/WIP] Manage some codepoints on XML
This commit is contained in:
parent
9e34ffe665
commit
cc2d53d9e9
1 changed files with 17 additions and 0 deletions
|
|
@ -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++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue