Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
misc
exam.security
microsoft_update_catalog
msdn.annotations
msdn.drgui.discussion
msdn.duwamish
msdn.general
msdn.magazine
msdn.soaptoolkit
msdn.webservices
msdntraining
opsmgr.connectors
opsmgr.sp1
technet
technet.howtofeedback
technet.howtoneeds
technet.magazine
technet.technettalks
  
 
date: Thu, 10 Apr 2008 15:06:21 +0100,    group: microsoft.public.msdn.general        back       


Converting character streams to Unicode   
MultiByteToWideChar does not seem to be an appropriate API for converting 
DBCS or UTF-8 streams to UTF-16, because it requires an integral number of 
those characters in its source buffer.  However, .Net has a Decoder class, 
which is documented as follows:

"A Decoder object maintains state information between successive calls to 
GetChars or Convert() methods so it can correctly decode byte sequences that 
span blocks. The Decoder also preserves trailing bytes at the end of data 
blocks and uses the trailing bytes in the next decoding operation. 
Therefore, GetDecoder and GetEncoder are useful for network transmission and 
file operations because those operations often deal with blocks of data 
instead of a complete data stream."

That's exactly what I need, but I don't want to use .Net.  Is there a way of 
achieving the same result using a Windows API?

Thanks.
date: Thu, 10 Apr 2008 15:06:21 +0100   author:   Keith MacDonald

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us