Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I manage to make GForth for Android to write 'å' and 'Å'?

120 views
Skip to first unread message

lehs

unread,
Jan 13, 2018, 12:18:13 PM1/13/18
to
I Scandinavia we have the letters å/Å which sounds like 'o' in 'forth'. But it doesn't work in the Android version when written out. In Fig-Forth such things where always possible to disclose but GForth code isn't always that transparent.

The utm-8(?) code for 'å' is 'C3 A5' and for 'Å' 'C3 85'.

(Bye the way, it isn't 'smorgasboard', but 'smörgåsbord' where 'ö' is like 'i' in 'sir', 'å' like 'o' in forth and 'o' like 'o' in 'to').

Coos Haak

unread,
Jan 13, 2018, 5:50:04 PM1/13/18
to
Op Sat, 13 Jan 2018 09:18:11 -0800 (PST) schreef lehs:

> I Scandinavia we have the letters å/Å which sounds like 'o' in 'forth'. But it doesn't work in the Android version when written out. In Fig-Forth such things where always possible to disclose but GForth code isn't always that transparent.
>
> The utm-8(?) code for 'å' is 'C3 A5' and for 'Å' 'C3 85'.
>
> (Bye the way, it isn't 'smorgasboard', but 'smörgåsbord' where 'ö' is like 'i' in 'sir', 'å' like 'o' in forth and 'o' like 'o' in 'to').

In FIGFORTH there is a word TRAVERSE to walk from the beginning of a name
the end (and the other way) that is based on the fact that the characters
are 7 bit with the highest bit only set at first and last character
just for TRAVERSE to work.
I can't imagine using accented letters in this system and at the
same time have lower case and uppercase.

groet Coos

lehs

unread,
Jan 14, 2018, 1:49:16 AM1/14/18
to
No, you couldn't have all the accented letters, but a few selected that was important in some particular language. In Sweden we replaced '{' with 'ä', '}' with 'å' and '|', for example. It was not perfect but it was possible.

Can anyone imagine how to make 'å' in GForth for Androids?

lehs

unread,
Jan 14, 2018, 1:50:30 AM1/14/18
to
Correction: '|' was replaced with 'ö'.

Julian Fondren

unread,
Jan 14, 2018, 2:15:43 AM1/14/18
to
On Sunday, January 14, 2018 at 12:49:16 AM UTC-6, lehs wrote:
> No, you couldn't have all the accented letters, but a few selected that was important in some particular language. In Sweden we replaced '{' with 'ä', '}' with 'å' and '|', for example. It was not perfect but it was possible.
>
> Can anyone imagine how to make 'å' in GForth for Androids?

IIRC, gl-terminal uses a .png as a palette to paint the screen.
Start by adding your characters to that.

Anton Ertl

unread,
Jan 14, 2018, 2:46:45 AM1/14/18
to
Coos Haak <htr...@gmail.com> writes:
>In FIGFORTH there is a word TRAVERSE to walk from the beginning of a name
>the end (and the other way) that is based on the fact that the characters
>are 7 bit with the highest bit only set at first and last character
>just for TRAVERSE to work.
>I can't imagine using accented letters in this system and at the
>same time have lower case and uppercase.

That's why Gforth has not used this system, nor have the other
standard systems that I have tested. In fig-Forth this system allowed
to keep only the first few letters of each word, but if we keep all
letters, we can use the length count to traverse the name in one
direction; and only one direction is necessary.

- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: http://www.forth200x.org/forth200x.html
EuroForth 2017: http://euro.theforth.net/

Coos Haak

unread,
Jan 14, 2018, 4:50:29 AM1/14/18
to
Op Sun, 14 Jan 2018 07:42:03 GMT schreef Anton Ertl:

> Coos Haak <htr...@gmail.com> writes:
>>In FIGFORTH there is a word TRAVERSE to walk from the beginning of a name
>>the end (and the other way) that is based on the fact that the characters
>>are 7 bit with the highest bit only set at first and last character
>>just for TRAVERSE to work.
>>I can't imagine using accented letters in this system and at the
>>same time have lower case and uppercase.
>
> That's why Gforth has not used this system, nor have the other
> standard systems that I have tested. In fig-Forth this system allowed
> to keep only the first few letters of each word, but if we keep all
> letters, we can use the length count to traverse the name in one
> direction; and only one direction is necessary.
>
> - anton

No, earlier versions like Polyforth used three letter words to save
space. Figforth kept all the letters and therefore TRAVERSE was invented.

groet Coos

Bernd Linsel

unread,
Jan 14, 2018, 5:15:56 AM1/14/18
to
Nowadays there is UTF-7 to represent all Unicode letters with 8 bits, so
that the MSB could be uses for this purpose.

Bernd Linsel

unread,
Jan 14, 2018, 5:17:24 AM1/14/18
to
On 1/14/2018 11:17 AM, Bernd Linsel wrote:
> Nowadays there is UTF-7 to represent all Unicode letters with 8 bits, so
> that the MSB could be uses for this purpose.

s/with 8 bits/with 7 bits/

Sorry.

a...@littlepinkcloud.invalid

unread,
Jan 14, 2018, 5:32:30 AM1/14/18
to
Coos Haak <htr...@gmail.com> wrote:
> Op Sat, 13 Jan 2018 09:18:11 -0800 (PST) schreef lehs:
>
>> I Scandinavia we have the letters ?/? which sounds like 'o' in 'forth'. But it doesn't work in the Android version when written out. In Fig-Forth such things where always possible to disclose but GForth code isn't always that transparent.
>>
>> The utm-8(?) code for '?' is 'C3 A5' and for '?' 'C3 85'.
>>
>> (Bye the way, it isn't 'smorgasboard', but 'sm?rg?sbord' where '?' is like 'i' in 'sir', '?' like 'o' in forth and 'o' like 'o' in 'to').
>
> In FIGFORTH there is a word TRAVERSE to walk from the beginning of a name
> the end (and the other way) that is based on the fact that the characters
> are 7 bit with the highest bit only set at first and last character
> just for TRAVERSE to work.
> I can't imagine using accented letters in this system and at the
> same time have lower case and uppercase.

Yes, but that was just a bad design decision in 1978. Having to
TRAVERSE to get down the dictionary was horrible, and there's no
reason to maintain such a mistake.

Andrew.

Anton Ertl

unread,
Jan 14, 2018, 6:05:28 AM1/14/18
to
Coos Haak <htr...@gmail.com> writes:
>Op Sun, 14 Jan 2018 07:42:03 GMT schreef Anton Ertl:
[fig-Forth TRAVERSE bit]
>> In fig-Forth this system allowed
>> to keep only the first few letters of each word, but if we keep all
>> letters, we can use the length count to traverse the name in one
>> direction; and only one direction is necessary.
>>
>> - anton
>
>No, earlier versions like Polyforth used three letter words to save
>space. Figforth kept all the letters and therefore TRAVERSE was invented.

You probably mean microForth, not polyForth. Yes, Forth, Inc.'s
earlier Forths had the three-char+length scheme to save space. And
later systems kept all chars, so the length information could be used
to traverse the name. fig-Forth, however, took an in-between
position: It had a usewr variable WIDTH that specified the stored
length of the name on creation. By default WIDTH was 31, and all
chars were kept, but you could, e.g., set it to 3 to get
microForth-like storage efficiency. Because the WIDTH was evaluated
at CREATE time, different words could have different stored lengths.
As a result, you could not use the length of the name to traverse it,
and they used the high bit to provide that additional information.

Of course with the spread of 8-bit encodings such as Latin-1 in the
1980s, and UTF-8 since 1994, this is not viable any more (and using
UTF-7 would pile another idiocy on top), and memory is not so scarce
that we need WIDTH any more (the fact that you forgot about WIDTH
shows that it was hardly used alreade in the heyday of fig-Forth),
that's why no Forth system that I have tested in this century uses the
high bit in the fig-Forth way.

Anton Ertl

unread,
Jan 14, 2018, 6:10:02 AM1/14/18
to
lehs <skydda...@gmail.com> writes:
>Can anyone imagine how to make '=C3=A5' in GForth for Androids?

I have no idea about Android input methods, but if you mange to type
it in, Gforth will happily process it. If you can only type in ASCII,
you can at least output the char using S\":

S\" \xC3\xA5" type

Of course, you need a terminal in UTF-8 mode to display it as you
want, but that should be no problem on Android.

lehs

unread,
Jan 14, 2018, 11:38:01 PM1/14/18
to
I think that the problem is about GForth for Android and about output, not input.

The german letters ß=\xC3\x9F, ä=\xC3\xA4 and ö=\xC3\xB6 gives the correct outputs but a lot of letters like å, ñ, à, é doesn't: diamonds with question marks are showed.

On GForth for Ubuntu everything works OK!

Anton Ertl

unread,
Jan 15, 2018, 3:59:32 AM1/15/18
to
lehs <skydda...@gmail.com> writes:
>The german letters =C3=9F=3D\xC3\x9F, =C3=A4=3D\xC3\xA4 and =C3=B6=3D\xC3\x=
>B6 gives the correct outputs but a lot of letters like =C3=A5, =C3=B1, =C3=
>=A0, =C3=A9 doesn't: diamonds with question marks are showed.

Yes, sounds like the font does not contain these characters.

bernd....@gmail.com

unread,
Jan 15, 2018, 3:46:57 PM1/15/18
to
Gforth's GL-Terminal, which the Android version uses to display the terminal, is essentially ASCII with very few exceptions. If you want to add a few more exceptions, you have to edit the /sdcard/gforth/current/minos2/ascii.png (white text on transparent background), and add the codes for those to xchars>glascii in .../minos2/gl-terminal.fs (line 271 and following). For Scandinavian languages, where you need only a few extra characters, this should work. For other languages, that's not a good idea.

I'm not very inclined to implement a full Unicode-capable OpenGL terminal; if you want to write a localized application, MINOS2 will be the framework of choice, which can deal with that. The terminal is to program in Forth, and that is primary ASCII.

lehs

unread,
Jan 18, 2018, 11:30:56 AM1/18/18
to
OK! Thanks for the answer! I'll look at it and see what I can do.
0 new messages