---
name: "need_uconvert"
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/need_uconvert"
---

# need\_uconvert(3alleg)

Tells if a string requires encoding conversion. Allegro game programming library.

## NAME

need\_uconvert - Tells if a string requires encoding conversion. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**int need\_uconvert(const char \*s, int type, int newtype);**

## DESCRIPTION

Given a pointer to a string (\`s'), a description of the type of the string (\`type'), and the type that you would like this string to be converted into (\`newtype'), this function tells you whether any conversion is required. No conversion will be needed if \`type' and \`newtype' are the same, or if one type is ASCII, the other is UTF-8, and the string contains only character values less than 128. As a convenience shortcut, you can pass the value U\_CURRENT as either of the type parameters, to represent whatever text encoding format is currently selected. Example:

```
   if (need_uconvert(text, U_UTF8, U_CURRENT)) {
      /* conversion is required */
   }
```

## RETURN VALUE

Returns non-zero if any conversion is required or zero otherwise.

## SEE ALSO

[**set\_uformat**(3alleg)](/set_uformat/3alleg.md), [**get\_uformat**(3alleg)](/get_uformat/3alleg.md), [**do\_uconvert**(3alleg)](/do_uconvert/3alleg.md), [**uconvert**(3alleg)](/uconvert/3alleg.md)
