delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/01/00:38:11

Message-ID: <8D53104ECD0CD211AF4000A0C9D60AE3015DAC4C@probe-2.acclaim-euro.net>
From: Shawn Hargreaves <ShawnH AT Probe DOT co DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: ASCII values in ALLEGRO
Date: Tue, 31 Aug 1999 14:54:06 +0100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.0.1460.8)
Reply-To: djgpp AT delorie DOT com

Erik Ellingsson writes:
> Because -we are swedish we want to use ASCII characters in the
> function textout( );

You mean non-ASCII characters. ASCII is a 7-bit character set, with
values from 0-31 being control codes, and 32-127 being the normal
visible characters. To display other characters, you need to use
higher values that aren't part of the standard ASCII set.

> The characters are between the value 128-255. Is this possible
> using ALLEGRO? and if it is possible how are we going to do this?

The 3.x versions of Allegro use 8 bit text, and the font structure
contains characters from 32 up to 255, so you can just print these
things directly, exactly as for any normal ASCII character. It is
up to you what codepage (order of characters) you decide to use
for the extended values: the default Allegro font is in Latin-1
format, which is the standard on most Unix systems, and close to
what Windows uses (Microsoft chose a slightly broken variant of
it), but will be different to the codepage used in your DOS
environment (DOS uses different character encodings for each
country). But the codepage is purely a matter of what font you
use, so if you are providing your own font, you can put the
characters in whatever order you like.

Future versions of Allegro will support Unicode, using UTF8 text 
encoding by default, but can be set to work with fixed size 8 bit
or 16 bit characters. You can get this code in the 
work-in-progress version available on the Allegro site, and
read www.unicode.org to find more info about what Unicode is.

Please don't post messages in HTML format, by the way.


	Shawn Hargreaves.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019