unicode?
hazul

I'm trying to use the 'ä' and 'ö' characters in my game (a and o with two dots on top).. but i'm only seeing a ' ^ ' character. Do i need to set unicode on or something? How do i do this?

DanielH

Yes

Click below on AGDN and select Unicode example.

Mars
The Allmighty Documentation said:

By default, Allegro uses UTF-8 encoded text (U_UTF8). This is a variable-width format, where characters can occupy anywhere from one to six bytes. The nice thing about it is that characters ranging from 0-127 are encoded directly as themselves, so UTF-8 is upwardly compatible with 7 bit ASCII ("Hello, World!" means the same thing regardless of whether you interpret it as ASCII or UTF-8 data). Any character values above 128, such as accented vowels, the UK currency symbol, and Arabic or Chinese characters, will be encoded as a sequence of two or more bytes, each in the range 128-255. This means you will never get what looks like a 7 bit ASCII character as part of the encoding of a different character value, which makes it very easy to manipulate UTF-8 strings.

There are a few editing programs that understand UTF-8 format text files. Alternatively, you can write your strings in plain ASCII or 16 bit Unicode formats, and then use the Allegro textconv program to convert them into UTF-8.

Just use SciTE to write your code and save as UTF-8. That should do the trick.

Joel Pettersson

I had this problem too.
The solution I used was adding set_uformat(U_ASCII); to the program before allegro_init();.

hazul

Thanks, joel. That did the trick :)

Thread #335857. Printed from Allegro.cc