On Mon, 21 Mar 2022, Raul Miller wrote:

2. That ability would not be removed. Functionality for interacting with OS interfaces would, generally, interpret data received as being utf8-encoded, and decode it.

In other words, exactly what the current implementation is doing. Except, that's not what you proposed.

You have instead proposed that for interacting with OS interfaces, the general case would be that literal (8 bit character) data is treated as ascii+latin1 with utf-8 as a special case exception.

That's not true.  That's backwards.

The current implementation does no automatic encoding or decoding.

It might be helpful to consider that, under my proposal, the distinction between 1-, 2-, and 4-byte characters is purely an implementation detail and an optimization, like using one byte per boolean. If the implementation used solely 4-byte characters, the observable behaviour would not change.

I am also not sure why you are talking about OS interfaces, but also say you are ignoring fread and fwrite. I did not say anything about any other OS interfaces.

I am also not sure why the absence of fread and fwrite from my motivating examples is significant. x=. 'aób' is not appreciably different from x=. fread't.txt', where t.txt contains aób; I opted for 8 u: 97 243 98 over both of those because it is self-contained and it can easily by replicated even by somebody whose email client has mangled the unicode. All instances of viewing the result of some sentence x could be as easily replaced by (":x)fwrite'res.txt'. In general, entering some sentence at the repl roughly corresponds to j freading from standard input, and viewing the result of that sentence roughly corresponds to j fwriting to standard output. Even in the case where that is not literally what happens (e.g. qtide), the result is an analogous call to a system routine (I am considering a GUI toolkit part of the system).

It seems to me that this thread is not going anywhere constructive, so I will probably desist from it now.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to