---
name: "set_uformat"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/set_uformat"
---

# set\_uformat(3alleg)

Set the global current text encoding format. Allegro game programming library.

## 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**(3alleg)](/get_uformat/3alleg.md), [**register\_uformat**(3alleg)](/register_uformat/3alleg.md), [**set\_ucodepage**(3alleg)](/set_ucodepage/3alleg.md), [**set\_uformat**(3alleg)](/set_uformat/3alleg.md), [**uconvert**(3alleg)](/uconvert/3alleg.md), [**ustrsize**(3alleg)](/ustrsize/3alleg.md), [**ugetc**(3alleg)](/ugetc/3alleg.md), [**ugetx**(3alleg)](/ugetx/3alleg.md), [**usetc**(3alleg)](/usetc/3alleg.md), [**uwidth**(3alleg)](/uwidth/3alleg.md), [**ucwidth**(3alleg)](/ucwidth/3alleg.md), [**uisok**(3alleg)](/uisok/3alleg.md), [**uoffset**(3alleg)](/uoffset/3alleg.md), [**ugetat**(3alleg)](/ugetat/3alleg.md), [**usetat**(3alleg)](/usetat/3alleg.md), [**uinsert**(3alleg)](/uinsert/3alleg.md), [**uremove**(3alleg)](/uremove/3alleg.md), [**allegro\_init**(3alleg)](/allegro_init/3alleg.md), [**exunicod**(3alleg)](/exunicod/3alleg.md)
