Click here to Skip to main content
15,905,590 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: small but high quality(color deph and pixel) toolbar? Pin
Mark Salsbery27-Jun-07 7:56
Mark Salsbery27-Jun-07 7:56 
GeneralRe: small but high quality(color deph and pixel) toolbar? Pin
Electronic7527-Jun-07 8:17
Electronic7527-Jun-07 8:17 
GeneralRe: small but high quality(color deph and pixel) toolbar? [modified] Pin
Mark Salsbery27-Jun-07 9:52
Mark Salsbery27-Jun-07 9:52 
GeneralRe: small but high quality(color deph and pixel) toolbar? Pin
Electronic7527-Jun-07 10:52
Electronic7527-Jun-07 10:52 
GeneralRe: small but high quality(color deph and pixel) toolbar? Pin
Mark Salsbery27-Jun-07 11:20
Mark Salsbery27-Jun-07 11:20 
GeneralRe: small but high quality(color deph and pixel) toolbar? Pin
Electronic7527-Jun-07 12:27
Electronic7527-Jun-07 12:27 
GeneralRe: small but high quality(color deph and pixel) toolbar? Pin
Mark Salsbery27-Jun-07 12:32
Mark Salsbery27-Jun-07 12:32 
QuestionDetect Code page using IMultiLanguage2 Interface (MS VC++ (Win32)) Pin
bikas_suman8327-Jun-07 3:47
bikas_suman8327-Jun-07 3:47 
Hi all,

I have this sample data in a .txt file,

-- Ne doit pas faire
-- é
select PARC.CONTYP
, PARC.CONSTA
, count(*)
from ParcNonCede PARC
, PLAN P
and PARC.CONSTA not in ('Stock', 'Détourné')
group by CONTYP, CONSTA
;

I am saving this in UTF-8 (not necessarily using Notepad).

Now I have this sample code to detect the Codepage of a buffer as below..
void
ExamineData(String &codepage, String &buffer)
{
IMultiLanguage2 *mlang;
DetectEncodingInfo info = {0};
MIMECPINFO codepageinfo;
int length = 0, cnt = 1;
String codepagestr; // String Datatype is my class
unsigned int len =1;

if(buffer.GetString())
length = buffer.GetLength();

HRESULT hr = S_OK;
SUCCEEDED(CoInitialize(NULL)); // init COM

hr = CoCreateInstance(CLSID_CMultiLanguage, NULL, CLSCTX_INPROC_SERVER, IID_IMultiLanguage2,(void **)&mlang);

hr = mlang->DetectInputCodepage(0,0, (wyChar *)buffer.GetString(), &length, &info, &cnt);

if(SUCCEEDED(hr))
{
hr = mlang->GetCodePageInfo(info.nCodePage, info.nLangID, &codepageinfo);
if(SUCCEEDED(hr))
codepage.SetAs(codepageinfo.wszDescription);
}

mlang->Release();
CoUninitialize();
}

Now this Function Detects the Codepage for the Buffer as "Western European (Windows)" even though it is an UTF-8. But Notepad is able to correctly detect it as UTF-8.

I am Not able to come to a conclusion whether it is a problem with the code or with the API.

Please Help me.

Thanks in Advance,
Manohar.S
AnswerRe: Detect Code page using IMultiLanguage2 Interface (MS VC++ (Win32)) Pin
bikas_suman8328-Jun-07 1:45
bikas_suman8328-Jun-07 1:45 
QuestionHow to test the network status Pin
kcynic27-Jun-07 3:24
kcynic27-Jun-07 3:24 
AnswerRe: How to test the network status Pin
Moak29-Jun-07 1:20
Moak29-Jun-07 1:20 
QuestionRelease the project Pin
kcynic27-Jun-07 3:13
kcynic27-Jun-07 3:13 
AnswerRe: Release the project Pin
aatul27-Jun-07 4:14
aatul27-Jun-07 4:14 
GeneralRe: Release the project Pin
kcynic27-Jun-07 23:37
kcynic27-Jun-07 23:37 
AnswerRe: Release the project Pin
sheshidar27-Jun-07 18:19
sheshidar27-Jun-07 18:19 
GeneralRe: Release the project Pin
kcynic27-Jun-07 23:42
kcynic27-Jun-07 23:42 
QuestionThread debug Pin
RichardS27-Jun-07 2:59
RichardS27-Jun-07 2:59 
AnswerRe: Thread debug Pin
BadKarma27-Jun-07 3:35
BadKarma27-Jun-07 3:35 
GeneralRe: Thread debug Pin
RichardS27-Jun-07 3:54
RichardS27-Jun-07 3:54 
GeneralRe: Thread debug Pin
led mike27-Jun-07 4:50
led mike27-Jun-07 4:50 
GeneralRe: Thread debug Pin
BadKarma27-Jun-07 5:19
BadKarma27-Jun-07 5:19 
QuestionLVN_BEGINDRAG Pin
baerten27-Jun-07 2:44
baerten27-Jun-07 2:44 
AnswerRe: LVN_BEGINDRAG Pin
KarstenK27-Jun-07 2:50
mveKarstenK27-Jun-07 2:50 
GeneralRe: LVN_BEGINDRAG Pin
baerten27-Jun-07 3:49
baerten27-Jun-07 3:49 
GeneralRe: LVN_BEGINDRAG Pin
KarstenK27-Jun-07 4:26
mveKarstenK27-Jun-07 4:26 

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.