mirror of
https://github.com/dlang/phobos.git
synced 2025-04-29 22:50:38 +03:00
12 lines
438 B
Text
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('ä'));
|
|
```
|