What is best way to convert an hex unicode to AnsiString? Ideally, for me, the input would be hex code is in AnsiString with format of "u\ABCD"; output is AnsiString.
AnsiString st,su,sx;
.
.
su="00a9" //value varies when called
TCHAR sx[10];
sx[0]=NULL;
su="0x"+su;
wsprintf(sx,"%c",su.ToInt());
st+=sx;
which seems to works for 0x00a9, but gives garbage for 0x5b89 (represents Chinese character) when viewed in TList or TMemo (Font and Font Name = MS Sans Serif.)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.