ncmpc  0.29
Functions
charset.h File Reference
#include "config.h"
#include "Compiler.h"
#include <stdbool.h>

Go to the source code of this file.

Functions

const char * charset_init (void)
 
gcc_pure unsigned utf8_width (const char *str)
 
gcc_pure unsigned locale_width (const char *p)
 
unsigned utf8_cut_width (char *p, unsigned max_width)
 
char * utf8_to_locale (const char *str)
 
char * locale_to_utf8 (const char *str)
 
char * replace_utf8_to_locale (char *src)
 
char * replace_locale_to_utf8 (char *src)
 

Function Documentation

◆ charset_init()

const char* charset_init ( void  )

◆ utf8_width()

gcc_pure unsigned utf8_width ( const char *  str)

Returns the number of terminal cells occupied by this string.

◆ locale_width()

gcc_pure unsigned locale_width ( const char *  p)

Returns the number of terminal cells occupied by this string.

◆ utf8_cut_width()

unsigned utf8_cut_width ( char *  p,
unsigned  max_width 
)

Limits the width of the specified string. Cuts it off before the specified width is exceeded.

Returns
the resulting width of the string

◆ utf8_to_locale()

char* utf8_to_locale ( const char *  str)

◆ locale_to_utf8()

char* locale_to_utf8 ( const char *  str)

◆ replace_utf8_to_locale()

char* replace_utf8_to_locale ( char *  src)

Converts the UTF-8 string to the locale, and frees the source pointer. Returns the source pointer as-is if no conversion is required.

◆ replace_locale_to_utf8()

char* replace_locale_to_utf8 ( char *  src)

Converts the locale string to UTF-8, and frees the source pointer. Returns the source pointer as-is if no conversion is required.