gmerlin
Typedefs | Functions
Charset utilities

Typedefs

typedef struct bg_charset_converter_s bg_charset_converter_t
 Opaque charset converter.
 

Functions

bg_charset_converter_tbg_charset_converter_create (const char *in_charset, const char *out_charset)
 Create a charset converter.
 
void bg_charset_converter_destroy (bg_charset_converter_t *cnv)
 Destroy a charset converter.
 
char * bg_convert_string (bg_charset_converter_t *cnv, const char *in_string, int in_len, int *out_len)
 Convert a string.
 

Detailed Description

Typedef Documentation

◆ bg_charset_converter_t

typedef struct bg_charset_converter_s bg_charset_converter_t

Opaque charset converter.

You don't want to know, what's inside

Function Documentation

◆ bg_charset_converter_create()

bg_charset_converter_t * bg_charset_converter_create ( const char * in_charset,
const char * out_charset )

Create a charset converter.

Parameters
in_charsetInput character set
out_charsetOutput character set
Returns
A newly allocated charset converte

in_charset and out_charset must be supported by iconv (type iconv -l for a list).

◆ bg_charset_converter_destroy()

void bg_charset_converter_destroy ( bg_charset_converter_t * cnv)

Destroy a charset converter.

Parameters
cnvA charset converter

◆ bg_convert_string()

char * bg_convert_string ( bg_charset_converter_t * cnv,
const char * in_string,
int in_len,
int * out_len )

Convert a string.

Parameters
cnvA charset converter
in_stringInput string
in_lenLength of input string or -1
out_lenIf non NULL, returns the length of the output string
Returns
A newly allocated string