character set conversion in unix C

Hi,

Could anybody explain how to change the character set of a particular string in C in unix. we are using HP-UX as OS. We require to change the input string which is in cp1250 format to utf-8.

A sample code would help. Thnx in advance

If you know how to do it at the command line with iconv, create a system() call to write it to a file.

There are C calls: iconv_open(), iconv(), iconv_close() if you need to do it extensively.

try man 3 iconv_open

Example code -
C Library Reference