Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

set_ucodepage(3alleg4) [linux man page]

set_ucodepage(3alleg4)						  Allegro manual					    set_ucodepage(3alleg4)

NAME
set_ucodepage - Sets 8-bit to Unicode conversion tables. Allegro game programming library. SYNOPSIS
#include <allegro.h> void set_ucodepage(const unsigned short *table, const unsigned short *extras); DESCRIPTION
When you select the U_ASCII_CP encoding mode, a set of tables are used to convert between 8-bit characters and their Unicode equivalents. You can use this function to specify a custom set of mapping tables, which allows you to support different 8-bit codepages. The `table' parameter points to an array of 256 shorts, which contain the Unicode value for each character in your codepage. The `extras' parameter, if not NULL, points to a list of mapping pairs, which will be used when reducing Unicode data to your codepage. Each pair con- sists of a Unicode value, followed by the way it should be represented in your codepage. The list is terminated by a zero Unicode value. This allows you to create a many->one mapping, where many different Unicode characters can be represented by a single codepage value (eg. for reducing accented vowels to 7-bit ASCII). Allegro will use the `table' parameter when it needs to convert an ASCII string to an Unicode string. But when Allegro converts an Unicode string to ASCII, it will use both parameters. First, it will loop through the `table' parameter looking for an index position pointing at the Unicode value it is trying to convert (ie. the `table' parameter is also used for reverse matching). If that fails, the `extras' list is used. If that fails too, Allegro will put the character `^', giving up the conversion. Note that Allegro comes with a default `table' and `extras' parameters set internally. The default `table' will convert 8-bit characters to `^'. The default `extras' list reduces Latin-1 and Extended-A characters to 7 bits in a sensible way (eg. an accented vowel will be reduced to the same vowel without the accent). SEE ALSO
set_uformat(3alleg4) Allegro version 4.4.2 set_ucodepage(3alleg4)

Check Out this Related Man Page

set_uformat(3alleg4)                                              Allegro manual                                              set_uformat(3alleg4)

NAME
set_uformat - Set the global current text encoding format. Allegro game programming library. SYNOPSIS
#include <allegro.h> void set_uformat(int type); DESCRIPTION
Sets the current text encoding format. This will affect all parts of Allegro, wherever you see a function that returns a char *, or takes a char * as a parameter. `type' should be one of these values: U_ASCII - fixed size, 8-bit ASCII characters U_ASCII_CP - alternative 8-bit codepage (see set_ucodepage()) U_UNICODE - fixed size, 16-bit Unicode characters U_UTF8 - variable size, UTF-8 format Unicode characters Although you can change the text format on the fly, this is not a good idea. Many strings, for example the names of your hardware drivers and any language translations, are loaded when you call allegro_init(), so if you change the encoding format after this, they will be in the wrong format, and things will not work properly. Generally you should only call set_uformat() once, before allegro_init(), and then leave it on the same setting for the duration of your program. SEE ALSO
get_uformat(3alleg4), register_uformat(3alleg4), set_ucodepage(3alleg4), set_uformat(3alleg4), uconvert(3alleg4), ustrsize(3alleg4), ugetc(3alleg4), ugetx(3alleg4), usetc(3alleg4), uwidth(3alleg4), ucwidth(3alleg4), uisok(3alleg4), uoffset(3alleg4), ugetat(3alleg4), use- tat(3alleg4), uinsert(3alleg4), uremove(3alleg4), allegro_init(3alleg4), exunicod(3alleg4) Allegro version 4.4.2 set_uformat(3alleg4)
Man Page