Solved

UNICODE support

Posted on 2004-10-13
2
210 Views
Last Modified: 2013-11-20
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.
0
Comment
Question by:sonawane_ajay
2 Comments
 
LVL 1

Accepted Solution

by:
cool_alok earned 150 total points
ID: 12297710
basically problem is that, basic display can't have basic Unicode support ,that why you are see ing the that boxes etc.

 now for removing these character you have to compare each character with ascii character set ie check ascii value each character .
hope this will work
 
0
 
LVL 12

Expert Comment

by:OnegaZhang
ID: 12297850
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
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now