phobos/changelog/add_isValidCharacter.dd
2021-07-05 10:00:30 +00:00

12 lines
438 B
Text

New function `isValidCharacter` in `std.utf`
A new function `isValidCharacter` has been added to `std.utf`. It can
be used to check if a single character forms a valid code point. For
example the `char` `0x80` is not a valid code point, because it can
only be used in trailing characters of UTF8 sequences, whereas the
wchar `ä` is a valid character:
```
assert(!isValidCharacter(cast(char) 0x80));
assert(isValidCharacter('ä'));
```