Solved

UNICODE support

Posted on 2004-10-13
2
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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 …
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.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

696 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