need_uconvert(3alleg)

need_uconvert3alleg

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

Usage

#include <allegro.h>

int need_uconvert(const char *s, int type, int newtype);

Overview

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.

Releases

4 releases since Debian 3.1 (Sarge); the text changed 2 times.

  1. 3.1
  2. 4.0
  3. 5.0–6.0

From liballegro-doc 2:4.2.2-2.2 in Debian 6.0 (Squeeze). Parsed by carta from the page's man source.