Util function to convert string charset.

This commit is contained in:
Vreixo Formoso
2007-12-27 21:11:29 +01:00
parent 1e4851792b
commit c3ded11773
3 changed files with 97 additions and 1 deletions

View File

@ -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