diff --git a/source/dyaml/reader.d b/source/dyaml/reader.d index 3cfe69a..f7607f7 100644 --- a/source/dyaml/reader.d +++ b/source/dyaml/reader.d @@ -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; } diff --git a/test/data/bmpchars.canonical b/test/data/bmpchars.canonical new file mode 100644 index 0000000..9b77b57 --- /dev/null +++ b/test/data/bmpchars.canonical @@ -0,0 +1,6 @@ +%YAML 1.1 +--- +!!map { + ? !!str "a" + : !!str "ð’…—" +} diff --git a/test/data/bmpchars.data b/test/data/bmpchars.data new file mode 100644 index 0000000..28e948e --- /dev/null +++ b/test/data/bmpchars.data @@ -0,0 +1 @@ +a: ð’…— \ No newline at end of file