On Sun, 24 Mar 2024 at
11:42, Alice Osako wrote:
I am trying to
find a suitable way to approach both file and console
I/O for my UNICODE library, and I am concerned that -
especially regarding console I/O - I may have to write
some sort of external C module which would be accessed
by FFI in some manner, which would act as a wrapper
around the wchar_t functions and handle the transitions
to and from the Unicode character types.
This is concerning, as I would rather find a native
Modula-2 solution if possible, but in this instance I
don't see a way to do so. Most of the existing I/O
operations for numbers auto-convert the values into
numeric text strings; the only exception to this is the
ISO RawIO and SRawIO libraries.
Unfortunately, while I tried to use [S]RawIO to
implement ReadUtf8Buffer and WriteUtf8Buffer, it didn't
have the desired behavior with console output. I've
checked in the two experimental procedures, if anyone is
curious, but the salient point is that it doesn't work
as intended. In any case, it would have been specific to
ISO support.
I am not sure I understand (1) what you are trying to do
and (2) what the problem is.
I am assuming though that you have UTF8 input that you
want to read into an ARRAY OF UNICHAR in memory, and
conversely an ARRAY OF UNICHAR that you want to write out as
UTF8 output, where UNICHAR is in UCS-4.