Use libiconv to convert the CP-1252 or ISO-8859-1 or whatever 8-bit character set you are converting from to UTF-8; something like this:
#include <iconv.h>
iconv_t cd = iconv_open("utf-8", "cp-1252");
iconv(cd, &inbuf, sizeof(inbuf), &outbuf, sizeof(outbuf)); // <- psuedocode, change to meet your needs
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…