Click here to Skip to main content
15,889,403 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Socket connection problem Pin
ForNow6-Jul-12 6:57
ForNow6-Jul-12 6:57 
AnswerRe: Socket connection problem Pin
fat_boy6-Jul-12 5:53
fat_boy6-Jul-12 5:53 
QuestionReading Buffer of unicode and ansi character Pin
john56326-Jul-12 0:06
john56326-Jul-12 0:06 
GeneralRe: Reading Buffer of unicode and ansi character Pin
Jochen Arndt6-Jul-12 0:22
professionalJochen Arndt6-Jul-12 0:22 
GeneralRe: Reading Buffer of unicode and ansi character Pin
john56326-Jul-12 0:39
john56326-Jul-12 0:39 
AnswerRe: Reading Buffer of unicode and ansi character Pin
Jochen Arndt6-Jul-12 0:56
professionalJochen Arndt6-Jul-12 0:56 
GeneralRe: Reading Buffer of unicode and ansi character Pin
john56326-Jul-12 1:09
john56326-Jul-12 1:09 
GeneralRe: Reading Buffer of unicode and ansi character Pin
Jochen Arndt6-Jul-12 1:18
professionalJochen Arndt6-Jul-12 1:18 
Detecting code page from BOM:
C++
UINT nCP = 0; // CP_ACP
if (0 == memcmp(lpszBuf, "\xEF\xBB\xBF", 3))
    nCP = CP_UTF8;
else if (0 == memcmp(lpszBuf, "\xFF\xFE", 2))
    nCP = 1200; // UTF-16LE
else if (0 == memcmp(lpszBuf, "\xFE\xFF", 2))
    nCP = 1201; // UTF-16BE


However, this requires the presence of a BOM. With text files, there should be one for UTF-16 and may be one with UTF-8. If you get your data from elsewhere (e.g. as network package), there may be no BOM.
GeneralRe: Reading Buffer of unicode and ansi character Pin
john56326-Jul-12 1:31
john56326-Jul-12 1:31 
GeneralRe: Reading Buffer of unicode and ansi character Pin
Jochen Arndt6-Jul-12 1:52
professionalJochen Arndt6-Jul-12 1:52 
GeneralRe: Reading Buffer of unicode and ansi character Pin
BCN-1637-Jul-12 16:32
BCN-1637-Jul-12 16:32 
GeneralRe: Reading Buffer of unicode and ansi character Pin
Jochen Arndt7-Jul-12 22:28
professionalJochen Arndt7-Jul-12 22:28 
GeneralRe: Reading Buffer of unicode and ansi character Pin
BCN-1638-Jul-12 2:36
BCN-1638-Jul-12 2:36 
QuestionProgramming Problem Pin
Ahmed Charfeddine5-Jul-12 22:54
Ahmed Charfeddine5-Jul-12 22:54 
GeneralRe: Programming Problem Pin
«_Superman_»6-Jul-12 17:55
professional«_Superman_»6-Jul-12 17:55 
GeneralRe: Programming Problem Pin
Ahmed Charfeddine7-Jul-12 0:25
Ahmed Charfeddine7-Jul-12 0:25 
QuestionFormat INT_MAX Pin
_Flaviu5-Jul-12 22:53
_Flaviu5-Jul-12 22:53 
AnswerRe: Format INT_MAX Pin
Jochen Arndt5-Jul-12 23:08
professionalJochen Arndt5-Jul-12 23:08 
GeneralRe: Format INT_MAX Pin
_Flaviu5-Jul-12 23:29
_Flaviu5-Jul-12 23:29 
GeneralRe: Format INT_MAX Pin
David Crow6-Jul-12 2:38
David Crow6-Jul-12 2:38 
GeneralRe: Format INT_MAX Pin
_Flaviu6-Jul-12 4:09
_Flaviu6-Jul-12 4:09 
QuestionRe: Format INT_MAX Pin
David Crow6-Jul-12 4:41
David Crow6-Jul-12 4:41 
GeneralGet Client Area Excluding Scroll Bar Pin
AmbiguousName5-Jul-12 19:30
AmbiguousName5-Jul-12 19:30 
GeneralRe: Get Client Area Excluding Scroll Bar Pin
Jochen Arndt5-Jul-12 21:32
professionalJochen Arndt5-Jul-12 21:32 
QuestionOne instance of object Pin
_Flaviu5-Jul-12 7:17
_Flaviu5-Jul-12 7:17 

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.