Click here to Skip to main content
15,887,262 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Who can find my import file ! mingw32 problem!!! Pin
zarelaky22-Apr-09 1:41
zarelaky22-Apr-09 1:41 
GeneralRe: Who can find my import file ! mingw32 problem!!! Pin
Stuart Dootson22-Apr-09 2:04
professionalStuart Dootson22-Apr-09 2:04 
GeneralRe: Who can find my import file ! mingw32 problem!!! Pin
zarelaky22-Apr-09 4:06
zarelaky22-Apr-09 4:06 
QuestionWriting a Unicode File using wofstream [modified] Pin
A&Ms21-Apr-09 4:33
A&Ms21-Apr-09 4:33 
AnswerRe: Writing a Unicode File using wofstream Pin
Stuart Dootson21-Apr-09 8:33
professionalStuart Dootson21-Apr-09 8:33 
AnswerRe: Writing a Unicode File using wofstream Pin
A&Ms21-Apr-09 10:43
A&Ms21-Apr-09 10:43 
GeneralRe: Writing a Unicode File using wofstream Pin
Stuart Dootson21-Apr-09 10:51
professionalStuart Dootson21-Apr-09 10:51 
GeneralRe: Writing a Unicode File using wofstream Pin
A&Ms21-Apr-09 22:17
A&Ms21-Apr-09 22:17 
Thank You for your explanation.

for an application to recognize a file encoding there were some articles in MSDN
[articles in MSDN] which says: The preferred place to specify byte order is in a file header, but text files do not have headers. Therefore, Unicode has defined a character (U+FEFF) and a noncharacter (U+FFFE) as byte order marks. They are mirror byte images of each other.

and then continues: When an application finds U+FEFF at the beginning of a text file, it typically processes the file as a Unicode file, although it can also perform further heuristic checks to verify that this is true. Such a check can be as simple as testing to find out if the variation in the low-order bytes is much higher than the variation in the high-order bytes. For example, if ASCII text is converted to Unicode text, every second byte is zero. Also, checking both for the linefeed and carriage-return characters (U+000A and U+000D) and for even or odd file size can provide a strong indicator of the nature of the file.

When an application finds U+FFFE at the beginning of a text file, it interprets it to mean that the file is a byte-reversed Unicode file. The application can either swap the order of the bytes or alert the user that an error has occurred.


But there is question of which method to use at the begining of reading a file for recognition,
do we ought to use a special sequense or sth else ...

if there is any one who has experiences about the case please replay the matter, and if there is some codes about this (that makes the job easy) please let us khnow that.Confused | :confused:
GeneralRe: Writing a Unicode File using wofstream Pin
Stuart Dootson21-Apr-09 22:28
professionalStuart Dootson21-Apr-09 22:28 
GeneralRe: Writing a Unicode File using wofstream Pin
A&Ms22-Apr-09 6:53
A&Ms22-Apr-09 6:53 
QuestionComparison of (int)DWORD Pin
Mikey_H21-Apr-09 4:27
Mikey_H21-Apr-09 4:27 
AnswerRe: Comparison of (int)DWORD Pin
Cedric Moonen21-Apr-09 4:32
Cedric Moonen21-Apr-09 4:32 
GeneralRe: Comparison of (int)DWORD Pin
Mikey_H21-Apr-09 4:42
Mikey_H21-Apr-09 4:42 
GeneralRe: Comparison of (int)DWORD Pin
Cedric Moonen21-Apr-09 4:46
Cedric Moonen21-Apr-09 4:46 
GeneralRe: Comparison of (int)DWORD [modified] Pin
Mikey_H21-Apr-09 5:07
Mikey_H21-Apr-09 5:07 
GeneralRe: Comparison of (int)DWORD Pin
Cedric Moonen21-Apr-09 7:20
Cedric Moonen21-Apr-09 7:20 
GeneralRe: Comparison of (int)DWORD Pin
Mikey_H21-Apr-09 7:24
Mikey_H21-Apr-09 7:24 
GeneralRe: Comparison of (int)DWORD Pin
Cedric Moonen21-Apr-09 8:22
Cedric Moonen21-Apr-09 8:22 
QuestionRe: Comparison of (int)DWORD Pin
David Crow21-Apr-09 7:56
David Crow21-Apr-09 7:56 
AnswerRe: Comparison of (int)DWORD Pin
Perry Holman21-Apr-09 7:13
Perry Holman21-Apr-09 7:13 
QuestionHow can i Discovery all user-defined process name from a unknow DLL Pin
SNArruda21-Apr-09 4:25
SNArruda21-Apr-09 4:25 
AnswerRe: How can i Discovery all user-defined process name from a unknow DLL Pin
Cedric Moonen21-Apr-09 4:51
Cedric Moonen21-Apr-09 4:51 
QuestionFormating a CString variable. Pin
V K 221-Apr-09 4:23
V K 221-Apr-09 4:23 
AnswerRe: Formating a CString variable. Pin
Code-o-mat21-Apr-09 5:24
Code-o-mat21-Apr-09 5:24 
AnswerRe: Formating a CString variable. Pin
Joe Woodbury21-Apr-09 5:24
professionalJoe Woodbury21-Apr-09 5:24 

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.