Hi All,
I have string which is Unicode and I want to convert to UTF-8 to show on RichEditcontrol as it supports UTF8 only. iam able to convert everything but only currency symbols like euro or rupees is coming as garbage etc
here is the string before conversion:
The bid of ₹ 29 is to be paid
after conversion:
The bid of ₹ 29 ( currency is only giving issue)
Please help me out in this.
What I have tried:
CStringA strUtf8 = CW2A(strTemp, CP_UTF8);
or
PSTR Utf8;
DWORD Length;
INT ReturnedLength;
//// A utf8 representation shouldn't be longer than 4 times the size
//// of the utf16 one.
Length = WideLength * 4;
if (!Utf8)
{
/* TODO: handle failure */
}
DWORD WideLength = _tcslen(strRTF) + 1;
Utf8 = (PSTR)malloc(WideLength * 4);
ReturnedLength = WideCharToMultiByte(CP_UTF8,
0,
WideString,
-1,
Utf8,
Length - 1,
NULL,
NULL);
if ( ReturnedLength )
{
// Need to zero terminate...
Utf8[ReturnedLength] = '\0';
}
else
{
/* TODO: handle failure */
}
free(Utf8);