/*
**********************************************************************
-* Copyright (c) 2002-2004, International Business Machines
+* Copyright (c) 2002-2005, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
**********************************************************************
#ifndef _CONVPERF_H
#define _CONVPERF_H
-#include "uperf.h"
+#include <mlang.h>
+#include <objbase.h>
+#include <stdlib.h>
#include "unicode/ucnv.h"
#include "unicode/uclean.h"
#include "unicode/ustring.h"
-#include <mlang.h>
-#include <objbase.h>
+
+#include "unicode/uperf.h"
#define CONVERSION_FLAGS (0) /*WC_DEFAULTCHAR WC_COMPOSITECHECK & WC_SEPCHARS*/
#define MAX_BUF_SIZE 3048
source, srcLen, &status);
if(status==U_BUFFER_OVERFLOW_ERROR) {
status=U_ZERO_ERROR;
- target=(UChar*)uprv_malloc((reqdLen) * U_SIZEOF_UCHAR*2);
+ target=(UChar*)malloc((reqdLen) * U_SIZEOF_UCHAR*2);
targetLimit = target + reqdLen;
if(target == NULL){
status = U_MEMORY_ALLOCATION_ERROR;
return srcLen;
}
~ICUToUnicodePerfFunction(){
- uprv_free(target);
+ free(target);
ucnv_close(conv);
}
};
source, srcLen, &status);
if(status==U_BUFFER_OVERFLOW_ERROR) {
status=U_ZERO_ERROR;
- target=(char*)uprv_malloc((reqdLen*2));
+ target=(char*)malloc((reqdLen*2));
targetLimit = target + reqdLen;
if(target == NULL){
status = U_MEMORY_ALLOCATION_ERROR;
return srcLen;
}
~ICUFromUnicodePerfFunction(){
- uprv_free(target);
+ free(target);
ucnv_close(conv);
}
};
mimeInfo.uiCodePage = 0;
mimeInfo.uiInternetEncoding =0;
/* get the charset info */
- pMulti->GetCharsetInfo(bEnc,&mimeInfo);
+ pMulti->GetCharsetInfo((wchar_t *)bEnc,&mimeInfo);
uiCodePage = (mimeInfo.uiInternetEncoding==0)?mimeInfo.uiCodePage:mimeInfo.uiInternetEncoding;
}
virtual void call(UErrorCode* status){
mimeInfo.uiCodePage = 0;
mimeInfo.uiInternetEncoding =0;
/* get the charset info */
- pMulti->GetCharsetInfo(bEnc,&mimeInfo);
+ pMulti->GetCharsetInfo((wchar_t *)bEnc,&mimeInfo);
uiCodePage = (mimeInfo.uiInternetEncoding==0)?mimeInfo.uiCodePage:mimeInfo.uiInternetEncoding;
}
virtual void call(UErrorCode* status){
tenc++;
}
/* get the charset info */
- pMulti->GetCharsetInfo(bEnc,&mimeInfo);
+ pMulti->GetCharsetInfo((wchar_t *)bEnc,&mimeInfo);
pMulti->CreateConvertCharset(mimeInfo.uiCodePage, 1200 /*unicode*/, (DWORD)0,&pConvToUni);
getErr(err,status);
src = source;
tenc++;
}
/* get the charset info */
- pMulti->GetCharsetInfo(bEnc,&mimeInfo);
+ pMulti->GetCharsetInfo((wchar_t *)bEnc,&mimeInfo);
pMulti->CreateConvertCharset(1200 /*unicode*/, mimeInfo.uiCodePage, (DWORD)0,&pConvFromUni);
getErr(err,status);
src = source;
MIMECSETINFO mimeInfo;
mimeInfo.uiCodePage = 0;
mimeInfo.uiInternetEncoding =0;
- pMulti->GetCharsetInfo(bEnc,&mimeInfo);
+ pMulti->GetCharsetInfo((wchar_t *)bEnc,&mimeInfo);
dwEnc = (mimeInfo.uiInternetEncoding==0)?mimeInfo.uiCodePage:mimeInfo.uiInternetEncoding;
}
mimeInfo.uiCodePage = 0;
mimeInfo.uiInternetEncoding =0;
- pMulti->GetCharsetInfo(bEnc,&mimeInfo);
+ pMulti->GetCharsetInfo((wchar_t *)bEnc,&mimeInfo);
dwEnc = (mimeInfo.uiInternetEncoding==0)?mimeInfo.uiCodePage:mimeInfo.uiInternetEncoding;
}