aboutsummaryrefslogtreecommitdiffstats
path: root/src/reader.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-12-24 22:43:25 +0000
committerDavid Robillard <d@drobilla.net>2013-12-24 22:43:25 +0000
commit2ecbc85f122fcf850f7254e54653255e999cd119 (patch)
tree032f8eeb99411f3686f0e3a41d00788c0300ab39 /src/reader.c
parenta38f60f807f7f00a9f88b2d59e3c3e776f41de8a (diff)
downloadserd-2ecbc85f122fcf850f7254e54653255e999cd119.tar.gz
serd-2ecbc85f122fcf850f7254e54653255e999cd119.tar.bz2
serd-2ecbc85f122fcf850f7254e54653255e999cd119.zip
Update to latest Turtle test suite.
Support UTF-8 in blank node names. Support idiotic SPARQL escaping in local names. git-svn-id: http://svn.drobilla.net/serd/trunk@452 490d8e77-9747-427b-9fa3-0b8f29cee8a0
Diffstat (limited to 'src/reader.c')
-rw-r--r--src/reader.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/reader.c b/src/reader.c
index f86bb630..664cb361 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -615,7 +615,10 @@ static bool
read_PN_CHARS_BASE(SerdReader* reader, Ref dest)
{
const uint8_t c = peek_byte(reader);
- if (is_alpha(c)) { // TODO: UTF-8
+ if ((c & 0x80)) { // Multi-byte character
+ return !read_utf8_character(reader, dest, eat_byte_safe(reader, c));
+ }
+ if (is_alpha(c)) {
push_byte(reader, dest, eat_byte_safe(reader, c));
return true;
}
@@ -626,7 +629,11 @@ static bool
read_PN_CHARS(SerdReader* reader, Ref dest)
{
const uint8_t c = peek_byte(reader);
- if (is_alpha(c) || is_digit(c) || c == '_' || c == '-') { // TODO: UTF-8
+ if ((c & 0x80)) { // Multi-byte character
+ return !read_utf8_character(reader, dest, eat_byte_safe(reader, c));
+ }
+
+ if (is_alpha(c) || is_digit(c) || c == '_' || c == '-') {
push_byte(reader, dest, eat_byte_safe(reader, c));
return true;
}