The output will be bad because of Windows specific behavior related to not outputting as UTF-16.

This will print all the characters in the block "Superscripts and Subscripts".

The Unicode database is very out of date (just waiting for merge for update), but should be ok for this example.

```
import std.uni : unicode;
import std.stdio : writefln;
void main() {
    foreach(c; unicode.InSuperscriptsandSubscripts.byCodepoint)
        writefln!"U+%X = "(c, c);
}
```

Unfortunately I'm not seeing an obvious way of determining subscript/superscript from what we have.

You can do it with the help of[0] via Super/Sub field values, which originate from UnicodeData.txt's Decomposition_Type field, but you shouldn't parse that if you only want just this one set of values.

[0] https://www.unicode.org/Public/15.0.0/ucd/extracted/DerivedDecompositionType.txt

Reply via email to