The OpenD Programming Language

isValidDchar

Check whether the given Unicode code point is valid.

pure nothrow @safe @nogc
bool
isValidDchar
(
dchar c
)

Parameters

c dchar

code point to check

Return Value

Type: bool

true if and only if c is a valid Unicode code point

Note: '\uFFFE' and '\uFFFF' are considered valid by isValidDchar, as they are permitted for internal use by an application, but they are not allowed for interchange by the Unicode standard.

Examples

assert( isValidDchar(cast(dchar) 0x41));
assert( isValidDchar(cast(dchar) 0x00));
assert(!isValidDchar(cast(dchar) 0xD800));
assert(!isValidDchar(cast(dchar) 0x11FFFF));

Meta