Add support for unicode chars in the 0x10000 - 0x10FFFF range as required by spec
This commit is contained in:
parent
e7ea38652b
commit
4a106181dd
|
@ -926,7 +926,8 @@ bool isPrintableValidUTF8(const char[] chars) @trusted pure nothrow @nogc
|
||||||
const dchar c = decodeValidUTF8NoGC(chars, index);
|
const dchar c = decodeValidUTF8NoGC(chars, index);
|
||||||
// We now c is not ASCII, so only check for printable non-ASCII chars.
|
// We now c is not ASCII, so only check for printable non-ASCII chars.
|
||||||
if(!(c == 0x85 || (c >= 0xA0 && c <= '\uD7FF') ||
|
if(!(c == 0x85 || (c >= 0xA0 && c <= '\uD7FF') ||
|
||||||
(c >= '\uE000' && c <= '\uFFFD')))
|
(c >= '\uE000' && c <= '\uFFFD') ||
|
||||||
|
(c >= '\U00010000' && c <= '\U0010FFFF')))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
6
test/data/bmpchars.canonical
Normal file
6
test/data/bmpchars.canonical
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
%YAML 1.1
|
||||||
|
---
|
||||||
|
!!map {
|
||||||
|
? !!str "a"
|
||||||
|
: !!str "𒅗"
|
||||||
|
}
|
1
test/data/bmpchars.data
Normal file
1
test/data/bmpchars.data
Normal file
|
@ -0,0 +1 @@
|
||||||
|
a: 𒅗
|
Loading…
Reference in a new issue