You can try widechar, and convert to utf8 (if you need utf8).
Or you need to create the byte-sequences yourself.
Btw, your code works at best for the first 128. After that it may print ansichars, but not unicode.
Unicode in can be encoded in utf8, utf16 and others. For
none widestring, it should be utf8.
In Utf8 the unicode 128 is encoded as 2 bytes: char($c2) + char($80)
Also that will give you codepoints. It will not give you chars.
Unicode U+0308
https://www.fileformat.info/info/unicode/char/0308/index.htm is
not a char.
It modifies the previous codepoint, and together they become a new char.
You can add many such modifiers, so there is no simple loop to print them all...
And other codepoints are surrogates, and can not be used on their own.
And there are gaps too. Not all numbers are defined. (but may get defined in future).
Also there are control chars.
https://www.fileformat.info/info/unicode/char/200f/index.htmWill not print a char. But the rest of the line (in the same writeln statement) will be written in right to left direction. (if your console supports this)
Package LazUtils unit LazUtf8 has UnicodeToUTF8()
This will get you the codepoint as string.
You still need the terminal to support utf8.
And you still need to deal with combining/surrogates/gaps...