Solved

UNICODE support

Posted on 2004-10-13
2
241 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.

740 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