Click here to Skip to main content
15,902,835 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem with WM_COMMAND Pin
Ryan Binns26-Jun-03 20:42
Ryan Binns26-Jun-03 20:42 
GeneralRe: Problem with WM_COMMAND Pin
anshumanshinde26-Jun-03 21:02
anshumanshinde26-Jun-03 21:02 
GeneralRe: Problem with WM_COMMAND Pin
Ryan Binns26-Jun-03 21:20
Ryan Binns26-Jun-03 21:20 
GeneralOne project add to other project Pin
Anonymous26-Jun-03 20:01
Anonymous26-Jun-03 20:01 
GeneralDirectShow 8.1 .. Problem Connecting two filters. Pin
Member 40481326-Jun-03 19:09
Member 40481326-Jun-03 19:09 
GeneralDeterming if a file is Unicode Pin
Taka Muraoka26-Jun-03 18:55
Taka Muraoka26-Jun-03 18:55 
GeneralRe: Determing if a file is Unicode Pin
Ryan Binns26-Jun-03 19:06
Ryan Binns26-Jun-03 19:06 
GeneralRe: Determing if a file is Unicode Pin
Dave Bryant26-Jun-03 19:14
Dave Bryant26-Jun-03 19:14 
In general 0xFF 0xFE means little-endian; 0xFE 0xFF means big-endian, and 0xEF 0xBB 0xBF means UTF-8.

When loading a file of unknown encoding, i normally look for these byte order marks first, then if they aren't found, i scan for null bytes in the string (an obvious giveaway of unicode), and if that fails then i check to see if the string conforms to UTF-8 (UTF-8 defines valid ranges for the first, second, and third bytes of a character). If all that fails, i load the string using the default character encoding of the system it is running on.

Of course, i'm normally dealing with EDI or XML messages, almost all of which start with english characters so if it is unicode i'll know after looking at the first two bytes of the message.

Dave
http://www.cloudsofheaven.org
GeneralRe: Determing if a file is Unicode Pin
Johnny ²26-Jun-03 19:47
Johnny ²26-Jun-03 19:47 
GeneralRe: Determing if a file is Unicode Pin
Ryan Binns27-Jun-03 5:06
Ryan Binns27-Jun-03 5:06 
GeneralRe: Determing if a file is Unicode Pin
Michael Dunn26-Jun-03 19:56
sitebuilderMichael Dunn26-Jun-03 19:56 
GeneralMultiple Selection with CRectTracker Pin
Vikrant Vikrant26-Jun-03 18:35
Vikrant Vikrant26-Jun-03 18:35 
GeneralHaving problems with MSVC++ 6.0. Pin
blackmesa26-Jun-03 18:20
blackmesa26-Jun-03 18:20 
GeneralRe: Having problems with MSVC++ 6.0. Pin
flip26-Jun-03 18:57
flip26-Jun-03 18:57 
GeneralRe: Having problems with MSVC++ 6.0. Pin
blackmesa26-Jun-03 19:18
blackmesa26-Jun-03 19:18 
GeneralRe: Having problems with MSVC++ 6.0. Pin
Ryan Binns26-Jun-03 20:40
Ryan Binns26-Jun-03 20:40 
GeneralRe: Having problems with MSVC++ 6.0. Pin
blackmesa27-Jun-03 5:00
blackmesa27-Jun-03 5:00 
GeneralRe: Having problems with MSVC++ 6.0. Pin
Ryan Binns27-Jun-03 5:04
Ryan Binns27-Jun-03 5:04 
GeneralAbout irregular window Pin
tinberdxq26-Jun-03 17:45
tinberdxq26-Jun-03 17:45 
GeneralDLL Security (.NET Securing) Pin
flip26-Jun-03 17:16
flip26-Jun-03 17:16 
GeneralRe: DLL Security (.NET Securing) Pin
Ryan Binns26-Jun-03 19:10
Ryan Binns26-Jun-03 19:10 
GeneralRe: DLL Security (.NET Securing) Pin
flip26-Jun-03 19:22
flip26-Jun-03 19:22 
GeneralRe: DLL Security (.NET Securing) Pin
Ryan Binns26-Jun-03 19:32
Ryan Binns26-Jun-03 19:32 
GeneralRe: DLL Security (.NET Securing) Pin
flip26-Jun-03 19:37
flip26-Jun-03 19:37 
GeneralRe: DLL Security (.NET Securing) Pin
Ryan Binns26-Jun-03 19:42
Ryan Binns26-Jun-03 19:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.