Defines | |
#define | VBI_NUL_TERMINATED -1 |
Functions | |
unsigned long | vbi_strlen_ucs2 (const uint16_t *src) |
char * | vbi_strndup_iconv_ucs2 (const char *dst_codeset, const uint16_t *src, long src_length, int repl_char) |
char * | vbi_strndup_iconv (const char *dst_codeset, const char *src_codeset, const char *src, unsigned long src_size, int repl_char) |
vbi_bool | vbi_fputs_iconv (FILE *fp, const char *dst_codeset, const char *src_codeset, const char *src, unsigned long src_size, int repl_char) |
vbi_bool | vbi_fputs_iconv_ucs2 (FILE *fp, const char *dst_codeset, const uint16_t *src, long src_length, int repl_char) |
const char * | vbi_locale_codeset (void) |
char * | vbi_strndup_iconv_caption (const char *dst_codeset, const char *src, long src_length, int repl_char) _vbi_alloc |
unsigned int | vbi_caption_unicode (unsigned int c, vbi_bool to_upper) |
unsigned long vbi_strlen_ucs2 | ( | const uint16_t * | src | ) |
src | NUL-terminated UCS-2 string. |
char * vbi_strndup_iconv_ucs2 | ( | const char * | dst_codeset, | |
const uint16_t * | src, | |||
long | src_length, | |||
int | repl_char | |||
) |
dst_codeset | Character set name for iconv() conversion, for example "ISO-8859-1". When NULL the default is UTF-8. | |
src | Source string in UCS-2 format, can be NULL . | |
src_length | Number of characters (not bytes) in the source string. Can be -1 if the string is NUL terminated. | |
repl_char | UCS-2 replacement for characters which are not representable in dst_codeset. When zero the function will fail if the source buffer contains unrepresentable characters. |
NULL
when the conversion fails, when it runs out of memory or when src is NULL
.char * vbi_strndup_iconv | ( | const char * | dst_codeset, | |
const char * | src_codeset, | |||
const char * | src, | |||
unsigned long | src_size, | |||
int | repl_char | |||
) |
dst_codeset | Character set name for iconv() conversion, for example "ISO-8859-1". When NULL the default is UTF-8. | |
src_codeset | Character set name for iconv() conversion, for example "ISO-8859-1". When NULL the default is UTF-8. | |
src | Source buffer, can be NULL . | |
src_size | Number of bytes in the source string (excluding the terminating NUL, if any). | |
repl_char | UCS-2 replacement for characters which are not representable in dst_codeset. When zero the function will fail if the source buffer contains unrepresentable characters. |
NULL
when the conversion fails, when it runs out of memory or when src is NULL
.vbi_bool vbi_fputs_iconv | ( | FILE * | fp, | |
const char * | dst_codeset, | |||
const char * | src_codeset, | |||
const char * | src, | |||
unsigned long | src_size, | |||
int | repl_char | |||
) |
fp | Output file. | |
dst_codeset | Character set name for iconv() conversion, for example "ISO-8859-1". When NULL the default is UTF-8. | |
src_codeset | Character set name for iconv() conversion, for example "ISO-8859-1". When NULL the default is UTF-8. | |
src | Source buffer, can be NULL . | |
src_size | Number of bytes in the source string (excluding the terminating NUL, if any). | |
repl_char | UCS-2 replacement for characters which are not representable in dst_codeset. When zero the function will fail if the source buffer contains unrepresentable characters. |
vbi_bool vbi_fputs_iconv_ucs2 | ( | FILE * | fp, | |
const char * | dst_codeset, | |||
const uint16_t * | src, | |||
long | src_length, | |||
int | repl_char | |||
) |
fp | Output file. | |
dst_codeset | Character set name for iconv() conversion, for example "ISO-8859-1". When NULL the default is UTF-8. | |
src | Source string in UCS-2 format, can be NULL . | |
src_length | Number of characters (not bytes) in the source string. Can be -1 if the string is NUL terminated. | |
repl_char | UCS-2 replacement for characters which are not representable in dst_codeset. When zero the function will fail if the source buffer contains unrepresentable characters. |
const char * vbi_locale_codeset | ( | void | ) |
Returns the character encoding used by the current locale, for example "UTF-8". NULL
if unknown.
Note applications must call
setlocale (LC_ALL, "");
char* vbi_strndup_iconv_caption | ( | const char * | dst_codeset, | |
const char * | src, | |||
long | src_length, | |||
int | repl_char | |||
) |
dst_codeset | Character set name for iconv() conversion, for example "ISO-8859-1". When NULL the default is UTF-8. | |
src | String of Closed Caption characters, can be NULL . | |
src_length | Number of characters (= bytes) in the source string. Can be -1 if the src string is NUL terminated. | |
repl_char | UCS-2 replacement for characters which are not representable in dst_codeset. When zero the function will fail if the source buffer contains unrepresentable characters. |
NULL
when the source buffer contains invalid two byte characters, when the conversion fails, when it runs out of memory or when src is NULL
.unsigned int vbi_caption_unicode | ( | unsigned int | c, | |
vbi_bool | to_upper | |||
) |
c | Character code in range 0x20 ... 0x7F, 0x1130 ... 0x113F, 0x1930 ... 0x193F, 0x1220 ... 0x123F, 0x1A20 ... 0x1A3F, 0x1320 ... 0x133F, 0x1B20 ... 0x1B3F. | |
to_upper | Convert the character to upper case. (Often programs are captioned in all upper case, but except for one character the basic and special CC character sets contain only lower case accented characters.) |