Hi,
i am converting a ascii to utf16 using following code.
void asciitounicode(unsigned short *unicode,char *str)
{
char *tmpstr;
unsigned short *tmpunicode = unicode;
tmpstr = (char *)str;
while( *tmpstr!= '\0' )
{
*tmpunicode = (unsigned short)*tmpstr;
tmpstr++;
tmpunicode ++;
}
*tmpstr= '\0';
}
now a want to convert the utf16 to utf8 so that it can be used in fopen which supports utf8 string.
thanks.
i am converting a ascii to utf16 using following code.
void asciitounicode(unsigned short *unicode,char *str)
{
char *tmpstr;
unsigned short *tmpunicode = unicode;
tmpstr = (char *)str;
while( *tmpstr!= '\0' )
{
*tmpunicode = (unsigned short)*tmpstr;
tmpstr++;
tmpunicode ++;
}
*tmpstr= '\0';
}
now a want to convert the utf16 to utf8 so that it can be used in fopen which supports utf8 string.
thanks.