[sword-cvs] icu-sword/source/test/perf/convperf convperf.cpp,NONE,1.1 convperf.dsp,NONE,1.1 convperf.h,NONE,1.1 convperf_ansi.pl,NONE,1.1 convperf_iml.pl,NONE,1.1 data.h,NONE,1.1

sword@www.crosswire.org sword@www.crosswire.org
Tue, 6 Apr 2004 03:09:52 -0700


Update of /cvs/core/icu-sword/source/test/perf/convperf
In directory www:/tmp/cvs-serv8911/source/test/perf/convperf

Added Files:
	convperf.cpp convperf.dsp convperf.h convperf_ansi.pl 
	convperf_iml.pl data.h 
Log Message:
ICU 2.8 sync

--- NEW FILE: convperf.cpp ---
/*
**********************************************************************
* Copyright (c) 2002-2003, International Business Machines
* Corporation and others.  All Rights Reserved.
**********************************************************************
**********************************************************************
*/
/** 
 * This Program tests the performance of ICU's Normalization engine against Windows
 * to run it use the command like
 *
 * c:\normperf.exe -s C:\work\ICUCupertinoRep\icu4c\collation-perf-data  -i 10 -p 15 -f TestNames_Asian.txt -u -e UTF-8  -l
 */
#include "convperf.h"
#include "data.h"

int main(int argc, const char* argv[]){
    UErrorCode status = U_ZERO_ERROR;
    ConverterPerformanceTest test(argc, argv, status);
    if(U_FAILURE(status)){
        return status;
    }
    if(test.run()==FALSE){
        fprintf(stderr,"FAILED: Tests could not be run please check the arguments.\n");
        return -1;
    }
    return 0;
}


ConverterPerformanceTest::ConverterPerformanceTest(int32_t argc, const char* argv[], UErrorCode& status)
: UPerfTest(argc,argv,status){
    
}

ConverterPerformanceTest::~ConverterPerformanceTest(){

}

UPerfFunction* ConverterPerformanceTest::runIndexedTest(int32_t index, UBool exec,const char* &name, char* par) {
    switch (index) {
        TESTCASE(0,TestICU_UTF8_ToUnicode);
        TESTCASE(1,TestICU_UTF8_FromUnicode);
        TESTCASE(2,TestWinANSI_UTF8_ToUnicode);
        TESTCASE(3,TestWinANSI_UTF8_FromUnicode);
        TESTCASE(4,TestWinIML2_UTF8_ToUnicode);
        TESTCASE(5,TestWinIML2_UTF8_FromUnicode);
        
        TESTCASE(6,TestICU_Latin1_ToUnicode);
        TESTCASE(7,TestICU_Latin1_FromUnicode);
        TESTCASE(8,TestWinIML2_Latin1_ToUnicode);
        TESTCASE(9,TestWinIML2_Latin1_FromUnicode);
        
        TESTCASE(10,TestICU_Latin8_ToUnicode);
        TESTCASE(11,TestICU_Latin8_FromUnicode);
        TESTCASE(12,TestWinIML2_Latin8_ToUnicode);
        TESTCASE(13,TestWinIML2_Latin8_FromUnicode);

        TESTCASE(14,TestICU_EBCDIC_Arabic_ToUnicode);
        TESTCASE(15,TestICU_EBCDIC_Arabic_FromUnicode);
        TESTCASE(16,TestWinIML2_EBCDIC_Arabic_ToUnicode);
        TESTCASE(17,TestWinIML2_EBCDIC_Arabic_FromUnicode);

        TESTCASE(18,TestICU_SJIS_ToUnicode);
        TESTCASE(19,TestICU_SJIS_FromUnicode);
        TESTCASE(20,TestWinIML2_SJIS_ToUnicode);
        TESTCASE(21,TestWinIML2_SJIS_FromUnicode);

        TESTCASE(22,TestICU_EUCJP_ToUnicode);
        TESTCASE(23,TestICU_EUCJP_FromUnicode);
        TESTCASE(24,TestWinIML2_EUCJP_ToUnicode);
        TESTCASE(25,TestWinIML2_EUCJP_FromUnicode);

        TESTCASE(26,TestICU_GB2312_FromUnicode);
        TESTCASE(27,TestICU_GB2312_ToUnicode);
        TESTCASE(28,TestWinIML2_GB2312_ToUnicode);
        TESTCASE(29,TestWinIML2_GB2312_FromUnicode);

        TESTCASE(30,TestICU_ISO2022KR_ToUnicode);
        TESTCASE(31,TestICU_ISO2022KR_FromUnicode);
        TESTCASE(32,TestWinIML2_ISO2022KR_ToUnicode);
        TESTCASE(33,TestWinIML2_ISO2022KR_FromUnicode);

        TESTCASE(34,TestICU_ISO2022JP_ToUnicode);
        TESTCASE(35,TestICU_ISO2022JP_FromUnicode);
        TESTCASE(36,TestWinIML2_ISO2022JP_ToUnicode);
        TESTCASE(37,TestWinIML2_ISO2022JP_FromUnicode);

        TESTCASE(38,TestWinANSI_Latin1_ToUnicode);
        TESTCASE(39,TestWinANSI_Latin1_FromUnicode);        
        
        TESTCASE(40,TestWinANSI_Latin8_ToUnicode);
        TESTCASE(41,TestWinANSI_Latin8_FromUnicode);
        
        TESTCASE(42,TestWinANSI_SJIS_ToUnicode);
        TESTCASE(43,TestWinANSI_SJIS_FromUnicode);
        
        TESTCASE(44,TestWinANSI_EUCJP_ToUnicode);
        TESTCASE(45,TestWinANSI_EUCJP_FromUnicode);
        
        TESTCASE(46,TestWinANSI_GB2312_ToUnicode);
        TESTCASE(47,TestWinANSI_GB2312_FromUnicode);
        
        TESTCASE(48,TestWinANSI_ISO2022KR_ToUnicode);
        TESTCASE(49,TestWinANSI_ISO2022KR_FromUnicode);        
        
        TESTCASE(50,TestWinANSI_ISO2022JP_ToUnicode);
        TESTCASE(51,TestWinANSI_ISO2022JP_FromUnicode);

        default: 
            name = ""; 
            return NULL;
    }
    return NULL;

}

UPerfFunction* ConverterPerformanceTest::TestICU_UTF8_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("utf-8",utf8_uniSource, LENGTHOF(utf8_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestICU_UTF8_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new ICUToUnicodePerfFunction("utf-8",(char*)utf8_encSource, LENGTHOF(utf8_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}


UPerfFunction* ConverterPerformanceTest::TestWinIML2_UTF8_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("utf-8",utf8_uniSource, LENGTHOF(utf8_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestWinIML2_UTF8_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("utf-8",(char*)utf8_encSource, LENGTHOF(utf8_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction* ConverterPerformanceTest::TestWinANSI_UTF8_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("utf-8",utf8_uniSource, LENGTHOF(utf8_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestWinANSI_UTF8_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("utf-8",(char*)utf8_encSource, LENGTHOF(utf8_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

//################

UPerfFunction* ConverterPerformanceTest::TestICU_Latin1_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-8859-1",latin1_uniSource, LENGTHOF(latin1_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestICU_Latin1_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new ICUToUnicodePerfFunction("iso-8859-1",(char*)latin1_encSource, LENGTHOF(latin1_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}


UPerfFunction* ConverterPerformanceTest::TestWinIML2_Latin1_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("iso-8859-1",latin1_uniSource, LENGTHOF(latin1_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestWinIML2_Latin1_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("iso-8859-1",(char*)latin1_encSource, LENGTHOF(latin1_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction* ConverterPerformanceTest::TestWinANSI_Latin1_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("iso-8859-1",latin1_uniSource, LENGTHOF(latin1_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestWinANSI_Latin1_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("iso-8859-1",(char*)latin1_encSource, LENGTHOF(latin1_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

//##################

UPerfFunction* ConverterPerformanceTest::TestICU_Latin8_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-8859-8",latin8_uniSource, LENGTHOF(latin8_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestICU_Latin8_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new ICUToUnicodePerfFunction("iso-8859-8",(char*)latin8_encSource, LENGTHOF(latin8_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}


UPerfFunction* ConverterPerformanceTest::TestWinIML2_Latin8_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("iso-8859-8",latin8_uniSource, LENGTHOF(latin8_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestWinIML2_Latin8_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("iso-8859-8",(char*)latin8_encSource, LENGTHOF(latin8_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}
UPerfFunction* ConverterPerformanceTest::TestWinANSI_Latin8_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("iso-8859-8",latin8_uniSource, LENGTHOF(latin8_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestWinANSI_Latin8_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("iso-8859-8",(char*)latin8_encSource, LENGTHOF(latin8_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

//#################


UPerfFunction* ConverterPerformanceTest::TestICU_EBCDIC_Arabic_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("x-EBCDIC-Arabic",ebcdic_arabic_uniSource, LENGTHOF(ebcdic_arabic_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestICU_EBCDIC_Arabic_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new ICUToUnicodePerfFunction("x-EBCDIC-Arabic",(char*)ebcdic_arabic_encSource, LENGTHOF(ebcdic_arabic_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}


UPerfFunction* ConverterPerformanceTest::TestWinIML2_EBCDIC_Arabic_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("x-EBCDIC-Arabic",ebcdic_arabic_uniSource, LENGTHOF(ebcdic_arabic_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestWinIML2_EBCDIC_Arabic_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("x-EBCDIC-Arabic",(char*)ebcdic_arabic_encSource, LENGTHOF(ebcdic_arabic_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction* ConverterPerformanceTest::TestWinANSI_EBCDIC_Arabic_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("x-EBCDIC-Arabic",ebcdic_arabic_uniSource, LENGTHOF(ebcdic_arabic_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestWinANSI_EBCDIC_Arabic_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("x-EBCDIC-Arabic",(char*)ebcdic_arabic_encSource, LENGTHOF(ebcdic_arabic_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}
//#################


UPerfFunction* ConverterPerformanceTest::TestICU_SJIS_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("sjis",sjis_uniSource, LENGTHOF(sjis_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestICU_SJIS_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new ICUToUnicodePerfFunction("sjis",(char*)sjis_encSource, LENGTHOF(sjis_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}


UPerfFunction* ConverterPerformanceTest::TestWinIML2_SJIS_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("sjis",sjis_uniSource, LENGTHOF(sjis_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestWinIML2_SJIS_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("sjis",(char*)sjis_encSource, LENGTHOF(sjis_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction* ConverterPerformanceTest::TestWinANSI_SJIS_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("sjis",sjis_uniSource, LENGTHOF(sjis_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestWinANSI_SJIS_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("sjis",(char*)sjis_encSource, LENGTHOF(sjis_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}


//#################


UPerfFunction* ConverterPerformanceTest::TestICU_EUCJP_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("euc-jp",eucjp_uniSource, LENGTHOF(eucjp_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestICU_EUCJP_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new ICUToUnicodePerfFunction("euc-jp",(char*)eucjp_encSource, LENGTHOF(eucjp_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}


UPerfFunction* ConverterPerformanceTest::TestWinIML2_EUCJP_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("euc-jp",eucjp_uniSource, LENGTHOF(eucjp_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestWinIML2_EUCJP_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("euc-jp",(char*)eucjp_encSource, LENGTHOF(eucjp_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction* ConverterPerformanceTest::TestWinANSI_EUCJP_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("euc-jp",eucjp_uniSource, LENGTHOF(eucjp_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestWinANSI_EUCJP_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("euc-jp",(char*)eucjp_encSource, LENGTHOF(eucjp_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}


//#################


UPerfFunction* ConverterPerformanceTest::TestICU_GB2312_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("gb2312",gb2312_uniSource, LENGTHOF(gb2312_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestICU_GB2312_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new ICUToUnicodePerfFunction("gb2312",(char*)gb2312_encSource, LENGTHOF(gb2312_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}


UPerfFunction* ConverterPerformanceTest::TestWinIML2_GB2312_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("gb2312",gb2312_uniSource, LENGTHOF(gb2312_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestWinIML2_GB2312_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("gb2312",(char*)gb2312_encSource, LENGTHOF(gb2312_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction* ConverterPerformanceTest::TestWinANSI_GB2312_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("gb2312",gb2312_uniSource, LENGTHOF(gb2312_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestWinANSI_GB2312_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("gb2312",(char*)gb2312_encSource, LENGTHOF(gb2312_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

//#################


UPerfFunction* ConverterPerformanceTest::TestICU_ISO2022KR_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-2022-kr",iso2022kr_uniSource, LENGTHOF(iso2022kr_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestICU_ISO2022KR_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new ICUToUnicodePerfFunction("iso-2022-kr",(char*)iso2022kr_encSource, LENGTHOF(iso2022kr_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}


UPerfFunction* ConverterPerformanceTest::TestWinIML2_ISO2022KR_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("iso-2022-kr",iso2022kr_uniSource, LENGTHOF(iso2022kr_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestWinIML2_ISO2022KR_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("iso-2022-kr",(char*)iso2022kr_encSource, LENGTHOF(iso2022kr_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction* ConverterPerformanceTest::TestWinANSI_ISO2022KR_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("iso-2022-kr",iso2022kr_uniSource, LENGTHOF(iso2022kr_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestWinANSI_ISO2022KR_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("iso-2022-kr",(char*)iso2022kr_encSource, LENGTHOF(iso2022kr_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}
//#################


UPerfFunction* ConverterPerformanceTest::TestICU_ISO2022JP_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-2022-jp",iso2022jp_uniSource, LENGTHOF(iso2022jp_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestICU_ISO2022JP_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new ICUToUnicodePerfFunction("iso-2022-jp",(char*)iso2022jp_encSource, LENGTHOF(iso2022jp_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}


UPerfFunction* ConverterPerformanceTest::TestWinIML2_ISO2022JP_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("iso-2022-jp",iso2022jp_uniSource, LENGTHOF(iso2022jp_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestWinIML2_ISO2022JP_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("iso-2022-jp",(char*)iso2022jp_encSource, LENGTHOF(iso2022jp_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction* ConverterPerformanceTest::TestWinANSI_ISO2022JP_FromUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("iso-2022-jp",iso2022jp_uniSource, LENGTHOF(iso2022jp_uniSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}

UPerfFunction*  ConverterPerformanceTest::TestWinANSI_ISO2022JP_ToUnicode(){
    UErrorCode status = U_ZERO_ERROR;
    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("iso-2022-jp",(char*)iso2022jp_encSource, LENGTHOF(iso2022jp_encSource), status);
    if(U_FAILURE(status)){
        return NULL;
    }
    return pf;
}
--- NEW FILE: convperf.dsp ---
# Microsoft Developer Studio Project File - Name="convperf" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **

# TARGTYPE "Win32 (x86) Console Application" 0x0103

CFG=convperf - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE 
!MESSAGE NMAKE /f "convperf.mak".
!MESSAGE 
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE 
!MESSAGE NMAKE /f "convperf.mak" CFG="convperf - Win32 Debug"
!MESSAGE 
!MESSAGE Possible choices for configuration are:
!MESSAGE 
!MESSAGE "convperf - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "convperf - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE 

# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe

!IF  "$(CFG)" == "convperf - Win32 Release"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\..\include" /I "..\..\..\common" /I "..\..\..\i18n" /I "..\..\..\tools\toolutil" /I "C:\Program Files\Microsoft SDK\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 icuuc.lib icuin.lib icutu.lib kernel32.lib user32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\..\lib\\"

!ELSEIF  "$(CFG)" == "convperf - Win32 Debug"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ  /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\..\include" /I "..\..\..\tools\ctestfw" /I "..\..\..\common" /I "..\..\..\i18n" /I "..\..\..\tools\toolutil" /I "C:\Program Files\Microsoft SDK\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ  /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 icuucd.lib icuind.lib icutud.lib kernel32.lib user32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\lib\\"

!ENDIF 

# Begin Target

# Name "convperf - Win32 Release"
# Name "convperf - Win32 Debug"
# Begin Group "Source Files"

# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File

SOURCE=.\convperf.cpp
# End Source File
# End Group
# Begin Group "Header Files"

# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File

SOURCE=.\convperf.h
# End Source File
# Begin Source File

SOURCE=.\data.h
# End Source File
# End Group
# Begin Group "Resource Files"

# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

--- NEW FILE: convperf.h ---
/*
**********************************************************************
* Copyright (c) 2002-2003, International Business Machines
* Corporation and others.  All Rights Reserved.
**********************************************************************
**********************************************************************
*/
#ifndef _CONVPERF_H
#define _CONVPERF_H

#include "uperf.h"
#include "unicode/ucnv.h"
#include "unicode/ustring.h"
#include <mlang.h>
#include <objbase.h>

#define CONVERSION_FLAGS (0) /*WC_DEFAULTCHAR WC_COMPOSITECHECK & WC_SEPCHARS*/
#define MAX_BUF_SIZE  3048
#define LENGTHOF(array) (sizeof(array)/sizeof((array)[0]))

class ICUToUnicodePerfFunction : public UPerfFunction{
private:
    UConverter* conv;
    const char* src;
    int32_t srcLen;
    UChar* target;
    UChar* targetLimit;
    
public:
    ICUToUnicodePerfFunction(const char* name,  const char* source, int32_t sourceLen, UErrorCode& status){
        conv = ucnv_open(name,&status);
        src = source;
        srcLen = sourceLen;
        if(U_FAILURE(status)){
            conv = NULL;
            return;
        }
        target = NULL;
        targetLimit = NULL;
        int32_t reqdLen = ucnv_toUChars(conv,   target, 0,
                                        source, srcLen, &status);
        if(status==U_BUFFER_OVERFLOW_ERROR) {
            status=U_ZERO_ERROR;
            target=(UChar*)uprv_malloc((reqdLen) * U_SIZEOF_UCHAR*2);
            targetLimit = target + reqdLen;
            if(target == NULL){
                status = U_MEMORY_ALLOCATION_ERROR;
                return;
            }
        }
    }
    virtual void call(UErrorCode* status){
        const char* mySrc = src;
        const char* sourceLimit = src + srcLen;
        UChar* myTarget = target;
        ucnv_toUnicode(conv, &myTarget, targetLimit, &mySrc, sourceLimit, NULL, TRUE, status);
    }
    virtual long getOperationsPerIteration(void){
        return srcLen;
    }
    ~ICUToUnicodePerfFunction(){
        uprv_free(target);
        ucnv_close(conv);
    }
};
class ICUFromUnicodePerfFunction : public UPerfFunction{
private:
    UConverter* conv;
    const UChar* src;
    int32_t srcLen;
    char* target;
    char* targetLimit;
    const char* name;
    
public:
    ICUFromUnicodePerfFunction(const char* name,  const UChar* source, int32_t sourceLen, UErrorCode& status){
        conv = ucnv_open(name,&status);
        src = source;
        srcLen = sourceLen;
        if(U_FAILURE(status)){
            conv = NULL;
            return;
        }
        target = NULL;
        targetLimit = NULL;
        int32_t reqdLen = ucnv_fromUChars(conv,   target, 0,
                                          source, srcLen, &status);
        if(status==U_BUFFER_OVERFLOW_ERROR) {
            status=U_ZERO_ERROR;
            target=(char*)uprv_malloc((reqdLen*2));
            targetLimit = target + reqdLen;
            if(target == NULL){
                status = U_MEMORY_ALLOCATION_ERROR;
                return;
            }
        }
    }
    virtual void call(UErrorCode* status){
        const UChar* mySrc = src;
        const UChar* sourceLimit = src + srcLen;
        char* myTarget = target;
        ucnv_fromUnicode(conv,&myTarget, targetLimit, &mySrc, sourceLimit, NULL, TRUE, status);
    }
    virtual long getOperationsPerIteration(void){
        return srcLen;
    }
    ~ICUFromUnicodePerfFunction(){
        uprv_free(target);
        ucnv_close(conv);
    }
};

class WinANSIToUnicodePerfFunction : public UPerfFunction{

private:
    DWORD uiCodePage;
    char* src; 
    UINT  srcLen;
    WCHAR dest[MAX_BUF_SIZE];
    UINT  dstLen;
    const char* name;
public:
    WinANSIToUnicodePerfFunction(const char* cpName, char* pszIn,UINT szLen, UErrorCode& status){
        name = cpName;
        src = pszIn;
        srcLen = szLen;
        dstLen = LENGTHOF(dest);
        unsigned short bEnc[30]={'\0'};
        const char* tenc=name;
        for(int i=0;*tenc!='\0';i++){
            bEnc[i]=*tenc;
            tenc++;
        }
        LPMULTILANGUAGE2 pMulti;
        
        CoInitialize(NULL);

        /* create instance of converter object*/
        CoCreateInstance(
                          __uuidof(CMultiLanguage),
                          NULL,
                          CLSCTX_SERVER,
                          __uuidof(IMultiLanguage2),
                          (void**)&pMulti
                          );



        MIMECSETINFO mimeInfo;
        
        mimeInfo.uiCodePage = 0;
        mimeInfo.uiInternetEncoding =0;
        /* get the charset info */
        pMulti->GetCharsetInfo(bEnc,&mimeInfo);
        uiCodePage = (mimeInfo.uiInternetEncoding==0)?mimeInfo.uiCodePage:mimeInfo.uiInternetEncoding;
    }
    virtual void call(UErrorCode* status){
        int winSize =MultiByteToWideChar(uiCodePage,CONVERSION_FLAGS,src,srcLen,dest,dstLen);
    }
    virtual long getOperationsPerIteration(void){
        return srcLen;
    }
};

class WinANSIFromUnicodePerfFunction : public UPerfFunction{

private:
    DWORD uiCodePage;
    WCHAR* src; 
    UINT  srcLen;
    char dest[MAX_BUF_SIZE];
    UINT  dstLen;
    const char* name;
    BOOL lpUsedDefaultChar;

public:
    WinANSIFromUnicodePerfFunction(const char* cpName,  WCHAR* pszIn,UINT szLen, UErrorCode& status){
        name = cpName;
        src = pszIn;
        srcLen = szLen;
        dstLen = LENGTHOF(dest);
        lpUsedDefaultChar=FALSE;
        unsigned short bEnc[30]={'\0'};
        const char* tenc=name;
        for(int i=0;*tenc!='\0';i++){
            bEnc[i]=*tenc;
            tenc++;
        }
        LPMULTILANGUAGE2 pMulti;
        
        CoInitialize(NULL);

        /* create instance of converter object*/
        CoCreateInstance(
                          __uuidof(CMultiLanguage),
                          NULL,
                          CLSCTX_SERVER,
                          __uuidof(IMultiLanguage2),
                          (void**)&pMulti
                          );



        MIMECSETINFO mimeInfo;
        mimeInfo.uiCodePage = 0;
        mimeInfo.uiInternetEncoding =0;
        /* get the charset info */
        pMulti->GetCharsetInfo(bEnc,&mimeInfo);
        uiCodePage = (mimeInfo.uiInternetEncoding==0)?mimeInfo.uiCodePage:mimeInfo.uiInternetEncoding;
    }
    virtual void call(UErrorCode* status){
        BOOL* pUsedDefaultChar =(uiCodePage==CP_UTF8)?NULL:&lpUsedDefaultChar;
        int winSize = WideCharToMultiByte(uiCodePage,CONVERSION_FLAGS,src,srcLen,dest,dstLen,NULL, pUsedDefaultChar);
    }
    virtual long getOperationsPerIteration(void){
        return srcLen;
    }
};
static inline void getErr(HRESULT err, UErrorCode& status){

    switch (err){

    case S_OK:
        //printf("Operation %s successful\n",operation);
        break;
    case S_FALSE:
        status = U_INTERNAL_PROGRAM_ERROR;
        break;
    case E_FAIL:
        status = U_ILLEGAL_CHAR_FOUND;
    }
}
class WinIMultiLanguageToUnicodePerfFunction : public UPerfFunction{

private:
    LPMULTILANGUAGE2 pMulti;
    LPMLANGCONVERTCHARSET pConvToUni;
    char* src; 
    UINT  srcLen;
    WCHAR dst[MAX_BUF_SIZE];
    UINT  dstLen;
    const char* cpName;

public:
    WinIMultiLanguageToUnicodePerfFunction(const char* name,char* source, UINT sourceLen, UErrorCode& status){
             
        CoInitialize(NULL);

        /* create instance of converter object*/
        CoCreateInstance(
                          __uuidof(CMultiLanguage),
                          NULL,
                          CLSCTX_SERVER,
                          __uuidof(IMultiLanguage2),
                          (void**)&pMulti
                          );



        MIMECSETINFO mimeInfo;
        mimeInfo.uiCodePage = 0;
        mimeInfo.uiInternetEncoding =0;
        HRESULT err=S_OK;
        unsigned short bEnc[30]={'\0'};
        const char* tenc=name;
        for(int i=0;*tenc!='\0';i++){
            bEnc[i]=*tenc;
            tenc++;
        }
        /* get the charset info */
        pMulti->GetCharsetInfo(bEnc,&mimeInfo);
        pMulti->CreateConvertCharset(mimeInfo.uiCodePage, 1200 /*unicode*/, (DWORD)0,&pConvToUni);
        getErr(err,status);
        src = source;
        srcLen = sourceLen;
        dstLen = LENGTHOF(dst);
        cpName = name;
    }

    virtual void call(UErrorCode* status){
        HRESULT err= pConvToUni->DoConversionToUnicode(src,&srcLen,dst, &dstLen);
        getErr(err,*status);
    }
    virtual long getOperationsPerIteration(void){
        return srcLen;
    }
};

class WinIMultiLanguageFromUnicodePerfFunction : public UPerfFunction{

private:
    LPMULTILANGUAGE2 pMulti;
    LPMLANGCONVERTCHARSET pConvFromUni;
    WCHAR* src; 
    UINT  srcLen;
    char dst[MAX_BUF_SIZE];
    UINT  dstLen;
    const char* cpName;

public:
    WinIMultiLanguageFromUnicodePerfFunction(const char* name,WCHAR* source, UINT sourceLen, UErrorCode& status){
             
        CoInitialize(NULL);

        /* create instance of converter object*/
        CoCreateInstance(
                          __uuidof(CMultiLanguage),
                          NULL,
                          CLSCTX_SERVER,
                          __uuidof(IMultiLanguage2),
                          (void**)&pMulti
                          );



        MIMECSETINFO mimeInfo;
        mimeInfo.uiCodePage = 0;
        mimeInfo.uiInternetEncoding =0;
        HRESULT err=S_OK;
        unsigned short bEnc[30]={'\0'};
        const char* tenc=name;
        for(int i=0;*tenc!='\0';i++){
            bEnc[i]=*tenc;
            tenc++;
        }
        /* get the charset info */
        pMulti->GetCharsetInfo(bEnc,&mimeInfo);
        pMulti->CreateConvertCharset(1200 /*unicode*/, mimeInfo.uiCodePage, (DWORD)0,&pConvFromUni);
        getErr(err,status);
        src = source;
        srcLen = sourceLen;
        dstLen = LENGTHOF(dst);
        cpName = name;

    }

    virtual void call(UErrorCode* status){
        HRESULT err= pConvFromUni->DoConversionFromUnicode(src,&srcLen,dst, &dstLen);
        getErr(err,*status);
    }
    virtual long getOperationsPerIteration(void){
        return srcLen;
    }
};

class WinIMultiLanguage2ToUnicodePerfFunction : public UPerfFunction{

private:
    LPMULTILANGUAGE2 pMulti;
    char* src; 
    UINT  srcLen;
    WCHAR dst[MAX_BUF_SIZE];
    UINT  dstLen;
    const char* cpName;
    DWORD dwEnc;
public:
    WinIMultiLanguage2ToUnicodePerfFunction(const char* name,char* source, UINT sourceLen, UErrorCode& status){
             
        CoInitialize(NULL);

        /* create instance of converter object*/
        CoCreateInstance(
                          __uuidof(CMultiLanguage),
                          NULL,
                          CLSCTX_SERVER,
                          __uuidof(IMultiLanguage2),
                          (void**)&pMulti
                          );

        src = source;
        srcLen = sourceLen;
        dstLen = LENGTHOF(dst);
        cpName = name;
        unsigned short bEnc[30]={'\0'};
        const char* tenc=name;
        for(int i=0;*tenc!='\0';i++){
            bEnc[i]=*tenc;
            tenc++;
        }
        /* get the charset info */
        MIMECSETINFO mimeInfo;
        mimeInfo.uiCodePage = 0;
        mimeInfo.uiInternetEncoding =0;
        pMulti->GetCharsetInfo(bEnc,&mimeInfo);
        dwEnc = (mimeInfo.uiInternetEncoding==0)?mimeInfo.uiCodePage:mimeInfo.uiInternetEncoding;
    }

    virtual void call(UErrorCode* status){
        DWORD dwMode=0;
        HRESULT err=  pMulti->ConvertStringToUnicode(&dwMode,dwEnc,(char*)src,&srcLen,dst, &dstLen);
        getErr(err,*status);
    }
    virtual long getOperationsPerIteration(void){
        return srcLen;
    }
};

class WinIMultiLanguage2FromUnicodePerfFunction : public UPerfFunction{

private:
    LPMULTILANGUAGE2 pMulti;
    LPMLANGCONVERTCHARSET pConvFromUni;
    WCHAR* src; 
    UINT  srcLen;
    char dst[MAX_BUF_SIZE];
    UINT  dstLen;
    const char* cpName;
    DWORD dwEnc;

public:
    WinIMultiLanguage2FromUnicodePerfFunction(const char* name,WCHAR* source, UINT sourceLen, UErrorCode& status){
             
        CoInitialize(NULL);

        /* create instance of converter object*/
        CoCreateInstance(
                          __uuidof(CMultiLanguage),
                          NULL,
                          CLSCTX_SERVER,
                          __uuidof(IMultiLanguage2),
                          (void**)&pMulti
                          );


        unsigned short bEnc[30]={'\0'};
        const char* tenc=name;
        for(int i=0;*tenc!='\0';i++){
            bEnc[i]=*tenc;
            tenc++;
        }
        src = source;
        srcLen = sourceLen;
        dstLen = LENGTHOF(dst);
        cpName = name;
        /* get the charset info */
        MIMECSETINFO mimeInfo;
        mimeInfo.uiCodePage = 0;
        mimeInfo.uiInternetEncoding =0;

        pMulti->GetCharsetInfo(bEnc,&mimeInfo);
        dwEnc = (mimeInfo.uiInternetEncoding==0)?mimeInfo.uiCodePage:mimeInfo.uiInternetEncoding;
    }

    virtual void call(UErrorCode* status){
        DWORD dwMode=0;
        HRESULT err= pMulti->ConvertStringFromUnicode(&dwMode,dwEnc,src,&srcLen,dst, &dstLen);
        getErr(err,*status);
    }
    virtual long getOperationsPerIteration(void){
        return srcLen;
    }
};

class  ConverterPerformanceTest : public UPerfTest{

public:

    ConverterPerformanceTest(int32_t argc, const char* argv[], UErrorCode& status);
    ~ConverterPerformanceTest();
    virtual UPerfFunction* runIndexedTest(int32_t index, UBool exec,const char* &name, char* par = NULL);    
    
    UPerfFunction* TestICU_UTF8_ToUnicode();
    UPerfFunction* TestICU_UTF8_FromUnicode();
    UPerfFunction* TestWinANSI_UTF8_ToUnicode();
    UPerfFunction* TestWinANSI_UTF8_FromUnicode();
    UPerfFunction* TestWinIML2_UTF8_ToUnicode();
    UPerfFunction* TestWinIML2_UTF8_FromUnicode();

        
    UPerfFunction* TestICU_Latin1_ToUnicode();
    UPerfFunction* TestICU_Latin1_FromUnicode();
    UPerfFunction* TestWinANSI_Latin1_ToUnicode();
    UPerfFunction* TestWinANSI_Latin1_FromUnicode();
    UPerfFunction* TestWinIML2_Latin1_ToUnicode();
    UPerfFunction* TestWinIML2_Latin1_FromUnicode();

    UPerfFunction* TestICU_EBCDIC_Arabic_ToUnicode();
    UPerfFunction* TestICU_EBCDIC_Arabic_FromUnicode();
    UPerfFunction* TestWinANSI_EBCDIC_Arabic_ToUnicode();
    UPerfFunction* TestWinANSI_EBCDIC_Arabic_FromUnicode();
    UPerfFunction* TestWinIML2_EBCDIC_Arabic_ToUnicode();
    UPerfFunction* TestWinIML2_EBCDIC_Arabic_FromUnicode();

    UPerfFunction* TestICU_Latin8_ToUnicode();
    UPerfFunction* TestICU_Latin8_FromUnicode();
    UPerfFunction* TestWinANSI_Latin8_ToUnicode();
    UPerfFunction* TestWinANSI_Latin8_FromUnicode();
    UPerfFunction* TestWinIML2_Latin8_ToUnicode();
    UPerfFunction* TestWinIML2_Latin8_FromUnicode();

    
    UPerfFunction* TestICU_SJIS_ToUnicode();
    UPerfFunction* TestICU_SJIS_FromUnicode();
    UPerfFunction* TestWinANSI_SJIS_ToUnicode();
    UPerfFunction* TestWinANSI_SJIS_FromUnicode();
    UPerfFunction* TestWinIML2_SJIS_ToUnicode();
    UPerfFunction* TestWinIML2_SJIS_FromUnicode();

    UPerfFunction* TestICU_EUCJP_ToUnicode();
    UPerfFunction* TestICU_EUCJP_FromUnicode();
    UPerfFunction* TestWinANSI_EUCJP_ToUnicode();
    UPerfFunction* TestWinANSI_EUCJP_FromUnicode();
    UPerfFunction* TestWinIML2_EUCJP_ToUnicode();
    UPerfFunction* TestWinIML2_EUCJP_FromUnicode();

    UPerfFunction* TestICU_GB2312_ToUnicode();
    UPerfFunction* TestICU_GB2312_FromUnicode();
    UPerfFunction* TestWinANSI_GB2312_ToUnicode();
    UPerfFunction* TestWinANSI_GB2312_FromUnicode();
    UPerfFunction* TestWinIML2_GB2312_ToUnicode();
    UPerfFunction* TestWinIML2_GB2312_FromUnicode();


    UPerfFunction* TestICU_ISO2022KR_ToUnicode();
    UPerfFunction* TestICU_ISO2022KR_FromUnicode();
    UPerfFunction* TestWinANSI_ISO2022KR_ToUnicode();
    UPerfFunction* TestWinANSI_ISO2022KR_FromUnicode();
    UPerfFunction* TestWinIML2_ISO2022KR_ToUnicode();
    UPerfFunction* TestWinIML2_ISO2022KR_FromUnicode();   

    UPerfFunction* TestICU_ISO2022JP_ToUnicode();
    UPerfFunction* TestICU_ISO2022JP_FromUnicode();
    UPerfFunction* TestWinANSI_ISO2022JP_ToUnicode();
    UPerfFunction* TestWinANSI_ISO2022JP_FromUnicode();
    UPerfFunction* TestWinIML2_ISO2022JP_ToUnicode();
    UPerfFunction* TestWinIML2_ISO2022JP_FromUnicode(); 

};

#endif


--- NEW FILE: convperf_ansi.pl ---
#!/usr/bin/perl -w
#  ********************************************************************
#  * COPYRIGHT:
#  * Copyright (c) 2002-2003, International Business Machines Corporation and
#  * others. All Rights Reserved.
#  ********************************************************************

use strict;

use lib '../perldriver';

use PerfFramework;


my $options = {
	       "title"=>"Conversion Performance: ICU 2.6 vs. Windows2000 ANSI Interface",
	       "headers"=>"Windows2000(IMultiLanguage2) ICU",
	       "operationIs"=>"code point",
	       "passes"=>"10",
	       "time"=>"5",
	       #"outputType"=>"HTML",
	       "dataDir"=>"c:/src/perf/data",
	       "outputDir"=>"../results"
	      };

# programs
# tests will be done for all the programs. Results will be stored and connected
my $p = "release/convperf.exe";

my $tests = { 
	     "UTF-8 From Unicode",          ["$p TestWinANSI_UTF8_FromUnicode"  ,    "$p TestICU_UTF8_FromUnicode" ],
	     "UTF-8 To Unicode",            ["$p TestWinANSI_UTF8_ToUnicode"    ,    "$p TestICU_UTF8_ToUnicode" ],
         ####
	     "ISO-8859-1 From Unicode",     ["$p TestWinANSI_Latin1_FromUnicode"  ,  "$p TestICU_Latin1_FromUnicode" ],
	     "ISO-8859-1 To Unicode",       ["$p TestWinANSI_Latin1_ToUnicode"    ,  "$p TestICU_Latin1_ToUnicode" ],
         ####
	     "Shift-JIS From Unicode",      ["$p TestWinANSI_SJIS_FromUnicode"  ,    "$p TestICU_SJIS_FromUnicode" ],
	     "Shift-JIS To Unicode",        ["$p TestWinANSI_SJIS_ToUnicode"    ,    "$p TestICU_SJIS_ToUnicode" ],
         ####
	     "EUC-JP From Unicode",         ["$p TestWinANSI_EUCJP_FromUnicode"  ,   "$p TestICU_EUCJP_FromUnicode" ],
	     "EUC-JP To Unicode",           ["$p TestWinANSI_EUCJP_ToUnicode"    ,   "$p TestICU_EUCJP_ToUnicode" ],
         ####
	     "GB2312 From Unicode",         ["$p TestWinANSI_GB2312_FromUnicode"  ,  "$p TestICU_GB2312_FromUnicode" ],
	     "GB2312 To Unicode",           ["$p TestWinANSI_GB2312_ToUnicode"    ,  "$p TestICU_GB2312_ToUnicode" ],
	    };

my $dataFiles = "";

runTests($options, $tests, $dataFiles);

--- NEW FILE: convperf_iml.pl ---
#!/usr/bin/perl -w
#  ********************************************************************
#  * COPYRIGHT:
#  * Copyright (c) 2002-2003, International Business Machines Corporation and
#  * others. All Rights Reserved.
#  ********************************************************************

use strict;

use lib '../perldriver';

use PerfFramework;


my $options = {
	       "title"=>"Conversion Performance: ICU 2.6 vs. Windows2000 IMultiLanguage Interface",
	       "headers"=>"Windows2000(IMultiLanguage2) ICU",
	       "operationIs"=>"code point",
	       "passes"=>"10",
	       "time"=>"5",
	       #"outputType"=>"HTML",
	       "dataDir"=>"c:/src/perf/data",
	       "outputDir"=>"../results"
	      };

# programs
# tests will be done for all the programs. Results will be stored and connected
my $p = "release/convperf.exe";

my $tests = { 
	     "UTF-8 From Unicode",          ["$p TestWinIML2_UTF8_FromUnicode"  ,    "$p TestICU_UTF8_FromUnicode" ],
	     "UTF-8 To Unicode",            ["$p TestWinIML2_UTF8_ToUnicode"    ,    "$p TestICU_UTF8_ToUnicode" ],
         ####
	     "ISO-8859-1 From Unicode",     ["$p TestWinIML2_Latin1_FromUnicode"  ,  "$p TestICU_Latin1_FromUnicode" ],
	     "ISO-8859-1 To Unicode",       ["$p TestWinIML2_Latin1_ToUnicode"    ,  "$p TestICU_Latin1_ToUnicode" ],
         ####
	     "Shift-JIS From Unicode",      ["$p TestWinIML2_SJIS_FromUnicode"  ,    "$p TestICU_SJIS_FromUnicode" ],
	     "Shift-JIS To Unicode",        ["$p TestWinIML2_SJIS_ToUnicode"    ,    "$p TestICU_SJIS_ToUnicode" ],
         ####
	     "EUC-JP From Unicode",         ["$p TestWinIML2_EUCJP_FromUnicode"  ,   "$p TestICU_EUCJP_FromUnicode" ],
	     "EUC-JP To Unicode",           ["$p TestWinIML2_EUCJP_ToUnicode"    ,   "$p TestICU_EUCJP_ToUnicode" ],
         ####
	     "GB2312 From Unicode",         ["$p TestWinIML2_GB2312_FromUnicode"  ,  "$p TestICU_GB2312_FromUnicode" ],
	     "GB2312 To Unicode",           ["$p TestWinIML2_GB2312_ToUnicode"    ,  "$p TestICU_GB2312_ToUnicode" ],
         ####
	     "ISO2022KR From Unicode",      ["$p TestWinIML2_ISO2022KR_FromUnicode",  "$p TestICU_ISO2022KR_FromUnicode" ],
	     "ISO2022KR To Unicode",        ["$p TestWinIML2_ISO2022KR_ToUnicode"  ,  "$p TestICU_ISO2022KR_ToUnicode" ],
         ####
	     "ISO2022JP From Unicode",      ["$p TestWinIML2_ISO2022JP_FromUnicode", "$p TestICU_ISO2022JP_FromUnicode" ],
	     "ISO2022JP To Unicode",        ["$p TestWinIML2_ISO2022JP_ToUnicode"  ,  "$p TestICU_ISO2022JP_ToUnicode" ],
	    };

my $dataFiles = "";

runTests($options, $tests, $dataFiles);

--- NEW FILE: data.h ---
/*
**********************************************************************
* Copyright (c) 2002-2003,International Business Machines
* Corporation and others.  All Rights Reserved.
**********************************************************************
**********************************************************************
*/
#ifndef _DATA_H
#define _DATA_H

char iso2022jp_encSource[]={
    0x1B,0x24,0x42,0x21,0x21,0x21,0x22,0x21,0x23,0x1B,0x28,0x42,0x20,0x1B,0x24,0x42,0x21,0x25,0x21,0x26,
    0x21,0x27,0x21,0x28,0x1B,0x28,0x42,0x0D,0x0A,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x0D,0x0A,0x1B,
    0x24,0x42,0x21,0x29,0x21,0x2A,0x21,0x2B,0x21,0x2C,0x21,0x2D,0x21,0x2E,0x21,0x2F,0x21,0x30,0x1B,0x28,
    0x42,0x0D,0x0A,0x4B,0x4C,0x4D,0x4E,0x4F,0x50,0x51,0x52,0x0D,0x0A,0x1B,0x24,0x42,0x21,0x31,0x21,0x32,
    0x21,0x33,0x21,0x34,0x21,0x35,0x21,0x36,0x21,0x37,0x21,0x38,0x1B,0x28,0x42,0x0D,0x0A,0x1B,0x24,0x42,
    0x21,0x39,0x21,0x3A,0x21,0x3B,0x21,0x3C,0x21,0x3D,0x21,0x3E,0x21,0x3F,0x1B,0x28,0x42,0x5C,0x0D,0x0A,
    0x1B,0x24,0x42,0x21,0x43,0x21,0x44,0x21,0x45,0x21,0x46,0x21,0x47,0x21,0x48,0x1B,0x28,0x42,0x0D,0x0A,
    0x1B,0x24,0x42,0x21,0x49,0x21,0x4A,0x21,0x4B,0x21,0x4C,0x25,0x2A,0x25,0x2B,0x25,0x2D,0x25,0x2F,0x1B,
[...2692 lines suppressed...]
    0xFF91,0xFF92,0xFF93,0xFF94,0xFF95,0xFF96,0xFF97,0xFF98,0x000D,0x000A,
    /**/
    0x3000,0x3001,0x3002,0x0020,0xFF0E,0x30FB,0xFF1A,0xFF1B,0x000D,0x000A,
    0x0043,0x0044,0x0045,0x0046,0x0047,0x0048,0x0049,0x004A,0x000D,0x000A,
    0xFF1F,0xFF01,0x309B,0x309C,0x00B4,0xFF40,0x00A8,0xFF3E,0x000D,0x000A,
    0x004B,0x004C,0x004D,0x004E,0x004F,0x0050,0x0051,0x0052,0x000D,0x000A,
    0xFFE3,0xFF3F,0x30FD,0x30FE,0x309D,0x309E,0x3003,0x4EDD,0x000D,0x000A,
    0x3005,0x3006,0x3007,0x30FC,0x2015,0x2010,0xFF0F,0x005C,
};

WCHAR utf8_uniSmSource[]={
    0x3000,0x3001,0x3002,0x0020,0xFF0E,0x30FB,0xFF1A,0xFF1B,0x000D,0x000A,
    0x0043,0x0044,0x0045,0x0046,0x0047,0x0048,0x0049,0x004A,0x000D,0x000A,
};
unsigned char utf8_encSmSource[]={
    0xE3,0x80,0x80,0xE3,0x80,0x81,0xE3,0x80,0x82,0x20,0xEF,0xBC,0x8E,0xE3,0x83,0xBB,
    0xEF,0xBC,0x9A,0xEF,0xBC,0x9B,0x0D,0x0A
};
#endif