UTF-32 and similar to bytes and back again

chris hermansen clhermansen@gmail.com
Sat Feb 7 04:15:27 GMT 2026


Hello everyone,

I'm going to ask a question from my almost complete ignorance, so please
feel free to roll eyes as much as possible...

If GNU Algol 68 characters are something like UTF-32 (I guess, UCS-4) and
assuming we want mode Book to be dealing with bytes (not Algol 68 bytes but
what the operating system thinks of as bytes), will we use something ilke
the C c32rtomb or maybe write our own proc to convert a 32 bit character to
(say) four 8 bit bytes (say) in big-endian order?

And vice-versa reading in?

Maybe posing this question another way in case the above doesn't make
sense...

Let's say I write

print(("Foo","bar",newline))

in my Algol 68 program, which passes through the File standin and the
Channel standin_channel to the Book associated therewith.

And that Book is manifested as a binary (byte) stream, and so the UCS-4
characters "F","o","o","B","a","r" and maybe "\n" need to be first
converted to 8 bit bytes and then written to that stream.

Is this a reasonable picture?

I should mention that I'm thinking Book instances need to operate at the
binary stream level because someone might want to write binary data to them
(or read binary data from them).

Or am I just missing the whole point of it all?

Thanks in advance!

-- 
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/algol68/attachments/20260206/5e6e942e/attachment.htm>


More information about the Algol68 mailing list