Merge pull request #92 from Herringway/bmp-fix

Fix issue #79: Support for non-BMP Unicode characters
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
This commit is contained in:
The Dlang Bot 2018-02-28 01:24:54 +01:00 committed by GitHub
commit 0784ca63ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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: 𒅗