Add support for unicode chars in the 0x10000 - 0x10FFFF range as required by spec

This commit is contained in:
Cameron Ross 2018-02-27 14:15:47 -04:00
parent e7ea38652b
commit 4a106181dd
No known key found for this signature in database
GPG key ID: 777897D98DC91C54
3 changed files with 9 additions and 1 deletions

View file

@ -926,7 +926,8 @@ bool isPrintableValidUTF8(const char[] chars) @trusted pure nothrow @nogc
const dchar c = decodeValidUTF8NoGC(chars, index);
// We now c is not ASCII, so only check for printable non-ASCII chars.
if(!(c == 0x85 || (c >= 0xA0 && c <= '\uD7FF') ||
(c >= '\uE000' && c <= '\uFFFD')))
(c >= '\uE000' && c <= '\uFFFD') ||
(c >= '\U00010000' && c <= '\U0010FFFF')))
{
return false;
}

View file

@ -0,0 +1,6 @@
%YAML 1.1
---
!!map {
? !!str "a"
: !!str "𒅗"
}

1
test/data/bmpchars.data Normal file
View file

@ -0,0 +1 @@
a: 𒅗