Question - internal representation of char in Algol 68
chris hermansen
clhermansen@gmail.com
Fri Jan 9 21:46:16 GMT 2026
Ok, I found this:
https://gcc.gnu.org/onlinedocs/ga68/POSIX-string-transput.html
where it states:
The following procedures read or write characters and strings from and to
> open files. The external encoding of the files is assumed to be UTF-8.
> Since Algol 68 chars are UCS-4, this means that reading or writing a
> character may involve reading or writing more than one byte, depending on
> the particular Unicode code points involved.
There appears to be some difference between UTF-32 and UCS-4; see this
article
https://stackoverflow.com/questions/30186631/what-is-the-difference-between-utf-32-and-ucs-4
in which comments indicate:
UCS-4 and UTF-32 are now identical except that the UTF-32 standard has
additional Unicode semantics
and
"Additional Unicode semantics" means the extra properties Unicode adds
> above and beyond the code points, such as bidirectionality, collation
> rules, normalization of forms, etc. Some features of Unicode have been
> implemented in software that technically only supports UCS, but those are
> extensions that partly implement Unicode.
So I guess I should ask, is Algol 68 char really UCS-4 or is it rather
UTF-32 and includes those extra semantics?
Not knowing the depth of collation rules, I can imagine there would be
circumstances where we might want to apply collation rules for comparing
two strings and other circumstances where we don't. I further suppose that
would require two different operators, maybe EQ and COLLATESTO?
On Fri, Jan 9, 2026 at 1:12 PM chris hermansen <clhermansen@gmail.com>
wrote:
> I notice in the online docs here:
>
> https://gcc.gnu.org/onlinedocs/ga68/Standard-modes.html
>
> this information:
>
> Mode: char
>
> Mode for character values. The character values are mapped one-to-one to
> code points in the 21-bit space of Unicode.
>
> To me this implies that char is implemented as UTF-32. And for some
> reason I think I have read that elsewhere, but I can't put my finger on it.
>
> Please confirm (or not) that mode char is UTF-32!
> --
> Chris Hermansen · clhermansen "at" gmail "dot" com
>
> C'est ma façon de parler.
>
--
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/20260109/876910ef/attachment.htm>
More information about the Algol68
mailing list