[I6] Adapting Glulx code to handle Unicode

In a recent bug report for the Vorple for I6 libraries (https://github.com/vorple/inform6/issues/22), I realized the problem was that the functions used werent handling unicode (the functions dont have the _uni suffix).

In order to fix this, is it as simple as changing the relevant functions to their _uni counterparts? (If so, it would only create problems if I forgot one presumably?)

Or do I need to do that + change my array types? (How do i declare an array type of a certain length?)
Or is there something else that needs to be done?

Thanks!

1 Like

I don’t know what the Vorple code is doing in there. But the I6 part of the answer is that glk_stream_open_memory uses byte arrays, but glk_stream_open_memory_uni uses word arrays. So declare the array you pass in with --> instead of ->, and then use --> to access its contents.

1 Like

Thank you zarf. And the length of what is in the array (or was printed inside the array) has to be saved from the last argument of stream_close, right? (There’s no equivalent for the -->0 of buffer arrays?)

Correct. Neither glk_stream_open_memory nor glk_stream_open_memory_uni uses the “zeroth element is the length” convention. (Although some parts of the parser do.)