Util function to convert string charset.
This commit is contained in:
19
src/util.h
19
src/util.h
@ -32,6 +32,23 @@ extern inline int round_up(unsigned int n, unsigned int mul)
|
||||
|
||||
int int_pow(int base, int power);
|
||||
|
||||
/**
|
||||
* Convert the charset encoding of a given string.
|
||||
*
|
||||
* @param input
|
||||
* Input string
|
||||
* @param icharset
|
||||
* Input charset. Must be supported by iconv
|
||||
* @param ocharset
|
||||
* Output charset. Must be supported by iconv
|
||||
* @param output
|
||||
* Location where the pointer to the ouput string will be stored
|
||||
* @return
|
||||
* 1 on success, < 0 on error
|
||||
*/
|
||||
int strconv(const char *input, const char *icharset, const char *ocharset,
|
||||
char **output);
|
||||
|
||||
/**
|
||||
* Convert a given string from any input charset to ASCII
|
||||
*
|
||||
@ -39,7 +56,7 @@ int int_pow(int base, int power);
|
||||
* Input charset. Must be supported by iconv
|
||||
* @param input
|
||||
* Input string
|
||||
* @param ouput
|
||||
* @param output
|
||||
* Location where the pointer to the ouput string will be stored
|
||||
* @return
|
||||
* 1 on success, < 0 on error
|
||||
|
Reference in New Issue
Block a user