Link to home
Start Free TrialLog in
Avatar of sonawane_ajay
sonawane_ajay

asked on

UNICODE support

Hello All
I am downloading one file from web having encoding UTF-8 ( Unicode Support ). After downloading , I am reading the file into buffer in CString.But when I saw the buffer I found that there are some unidentified characters ( Looks like empty spaces but not spaces ). I am getting the same buffer though I converted it into UNIOCODE using MultiByteToWideChar.
like this
MultiByteToWideChar( CP_ACP, 0,str,strlen(str)+1, wszStr,256 );  

NOw what can I do to see those unidentified characters ?  If not possible , How can I remove those characters ?
Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of cool_alok
cool_alok

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of OnegaZhang
OnegaZhang

if the source is utf8, you should pass CP_UTF8 to MultiByteToWideChar

MultiByteToWideChar( CP_UTF8, 0,str,strlen(str)+1, wszStr,256 );  
look up msdn to see return value of MultiByteToWideChar, your buffer may be too small.

welcome to www.fruitfruit.com