Examples of recode()


Examples of com.mysql.ndbjtie.mysql.CharsetMap.recode()

            out.println("     --> RECODE TEST 1: recode from UTF-8 to Latin 1");
            ByteBuffer my_word_utf8      = char2bb(cmy_word_utf8);
            ByteBuffer result_buff       = ByteBuffer.allocateDirect(16);
            int[] lengths = new int[]  { 7 , 16 };
           
            int rr1 = csmap.recode(lengths, utf8_num, latin1_num,
                                   my_word_utf8, result_buff);
            printRecodeResult(rr1, lengths, my_word_utf8, result_buff);
            assert(rr1 == CharsetMapConst.RecodeStatus.RECODE_OK);
            assert(lengths[0] == 7);
            assert(lengths[1] == 6);
View Full Code Here

Examples of com.mysql.ndbjtie.mysql.CharsetMap.recode()

            out.println("     --> RECODE TEST 2: recode from Latin1 to to UTF-8");
            ByteBuffer my_word_latin1    = char2bb(cmy_word_latin1);
            ByteBuffer result_buff       = ByteBuffer.allocateDirect(16);
            int[] lengths = new int[]  { 6 , 16 };

            int rr2 = csmap.recode(lengths, latin1_num, utf8_num,
                                   my_word_latin1, result_buff);
            printRecodeResult(rr2, lengths, my_word_latin1, result_buff);
            assert(rr2 == CharsetMapConst.RecodeStatus.RECODE_OK);
            assert(lengths[0] == 6);
            assert(lengths[1] == 7);
View Full Code Here

Examples of com.mysql.ndbjtie.mysql.CharsetMap.recode()

            ByteBuffer my_word_latin1    = char2bb(cmy_word_latin1);
            ByteBuffer result_buff       = ByteBuffer.allocateDirect(16);
            ByteBuffer my_word_truncated = char2bb(cmy_word_truncated);
            int[] lengths = new int[]  { 6 , 4 };   // 4 is too small
 
            int rr3 = csmap.recode(lengths, latin1_num, utf8_num,
                               my_word_latin1, result_buff);
            printRecodeResult(rr3, lengths, my_word_latin1, result_buff);
            assert(rr3 == CharsetMapConst.RecodeStatus.RECODE_BUFF_TOO_SMALL);
            assert(lengths[0] == 3);
            assert(lengths[1] == 4);
View Full Code Here

Examples of com.mysql.ndbjtie.mysql.CharsetMap.recode()

        {
            out.println("     --> RECODE TEST 4: invalid character set");
            ByteBuffer my_word_latin1    = char2bb(cmy_word_latin1);
            ByteBuffer result_buff       = ByteBuffer.allocateDirect(16);
            int[] lengths = new int[]  { 6 , 16 };          
            int rr4 = csmap.recode(lengths, 0, 999, my_word_latin1, result_buff);
            out.println("          Return code: " + rr4);
            assert(rr4 == CharsetMapConst.RecodeStatus.RECODE_BAD_CHARSET);
            out.println("     <-- RECODE TEST 4");
        }
       
View Full Code Here

Examples of com.mysql.ndbjtie.mysql.CharsetMap.recode()

        {
            out.println("     --> RECODE TEST 5: source string is ill-formed UTF-8");
            ByteBuffer my_bad_utf8       = char2bb(cmy_bad_utf8);
            ByteBuffer result_buff       = ByteBuffer.allocateDirect(16);
            int[] lengths = new int[]  { 5 , 16 };         
            int rr5 = csmap.recode(lengths, utf8_num, latin1_num,
                                   my_bad_utf8, result_buff);
            out.println("          Return code: " + rr5);
            assert(rr5 == CharsetMapConst.RecodeStatus.RECODE_BAD_SRC);
            out.println("     <-- RECODE TEST 5");
        }
View Full Code Here

Examples of com.mysql.ndbjtie.mysql.CharsetMap.recode()

            cb.append("\u00FClker");
            cb.rewind();
            ByteBuffer result_buff       = ByteBuffer.allocateDirect(16);           
            int[] lengths = new int[]  { 12 , 16 };

            int rr6 = csmap.recode(lengths, utf16_num, utf8_num,
                                   str_bb, result_buff);
            printRecodeResult(rr6, lengths, str_bb, result_buff);           
            assert(lengths[0]) == 12;
            assert(lengths[1]) == 7;
            assert(bbncmp(result_buff, char2bb(cmy_word_utf8), 6) == 0);       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.