Changeset 469
- Timestamp:
- 09/03/07 15:11:17 (1 year ago)
- Files:
-
- trunk/thune/encoding.c (modified) (5 diffs)
- trunk/thune/make.c (modified) (1 diff)
- trunk/thune/print.c (modified) (2 diffs)
- trunk/thune/series.c (modified) (9 diffs)
- trunk/thune/stdio.c (modified) (1 diff)
- trunk/thune/tests/working/encode.good (modified) (1 diff)
- trunk/thune/tests/working/encode.t (modified) (2 diffs)
- trunk/thune/urlan.c (modified) (1 diff)
- trunk/thune/urlan.h (modified) (1 diff)
- trunk/thune/urlan_atoms.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/thune/encoding.c
r458 r469 119 119 switch( ur_encoding(res) ) 120 120 { 121 case UR_ENC_U TF16:121 case UR_ENC_UCS2: 122 122 count >>= 1; 123 123 strN = ur_makeBinary( count * 2, &bin ); … … 137 137 goto set_result; 138 138 139 case UR_ENC_U TF16:139 case UR_ENC_UCS2: 140 140 goto set_result; 141 141 } … … 143 143 break; 144 144 145 case UR_ATOM_U TF16:145 case UR_ATOM_UCS2: 146 146 switch( ur_encoding(res) ) 147 147 { … … 150 150 bin->used = copyAsciiToUtf16( bin->ptr.u16, 151 151 cpA, count ); 152 enc = UR_ENC_U TF16;152 enc = UR_ENC_UCS2; 153 153 goto set_result; 154 154 } … … 179 179 //case UR_ENC_ASCII: atom = UR_ATOM_ASCII; break; 180 180 case UR_ENC_UTF8: atom = UR_ATOM_UTF8; break; 181 case UR_ENC_U TF16: atom = UR_ATOM_UTF16;break;181 case UR_ENC_UCS2: atom = UR_ATOM_UCS2; break; 182 182 } 183 183 trunk/thune/make.c
r458 r469 710 710 _makeString16( str, (const uint8_t*) txt, len ); 711 711 ur_initString( res, strN, 0 ); 712 ur_setEncoding( res, UR_ENC_U TF16);712 ur_setEncoding( res, UR_ENC_UCS2 ); 713 713 return str; 714 714 } trunk/thune/print.c
r467 r469 76 76 break; 77 77 78 case UR_ENC_U TF16:78 case UR_ENC_UCS2: 79 79 ur_strCatUcs2( out, str2->ptr.u16 + si, used ); 80 80 break; … … 1006 1006 if( n < val->series.it ) 1007 1007 n = val->series.it; 1008 if( ur_encoding(val) == UR_ENC_U TF16)1008 if( ur_encoding(val) == UR_ENC_UCS2 ) 1009 1009 { 1010 1010 _appendStringUtf16( out, str->ptr.u16 + val->series.it, trunk/thune/series.c
r468 r469 151 151 bin = ur_bin(cell); 152 152 end = ur_sliceEnd(cell, bin); 153 if( ur_encoding(cell) == UR_ENC_U TF16)153 if( ur_encoding(cell) == UR_ENC_UCS2 ) 154 154 goto set_pointers2; 155 155 goto set_pointers; … … 1335 1335 if( tos->series.it < arr->used ) 1336 1336 { 1337 if( ur_encoding(tos) == UR_ENC_U TF16)1337 if( ur_encoding(tos) == UR_ENC_UCS2 ) 1338 1338 ur_arrayErase( arr, sizeof(uint16_t), tos->series.it, len ); 1339 1339 else … … 1546 1546 if( ((uint32_t) n) < ((uint32_t) end) ) 1547 1547 { 1548 if( ur_encoding(ser) == UR_ENC_U TF16)1548 if( ur_encoding(ser) == UR_ENC_UCS2 ) 1549 1549 ur_int(result) = bin->ptr.u16[ n ]; 1550 1550 else … … 1688 1688 if( ur_itAtPos( tos, n ) ) 1689 1689 break; 1690 if( ur_encoding(tos) == UR_ENC_U TF16)1690 if( ur_encoding(tos) == UR_ENC_UCS2 ) 1691 1691 ur_int(tos) = bin->ptr.u16[ n - 1 ]; 1692 1692 else … … 2027 2027 IF_POKE_IN_RANGE 2028 2028 { 2029 if( ur_encoding(ser) == UR_ENC_U TF16)2029 if( ur_encoding(ser) == UR_ENC_UCS2 ) 2030 2030 arr->ptr.u16[ n ] = ur_int(val); 2031 2031 else … … 3260 3260 if( cp ) 3261 3261 { 3262 if( ur_encoding(tos) == UR_ENC_U TF16)3262 if( ur_encoding(tos) == UR_ENC_UCS2 ) 3263 3263 { 3264 3264 uint16_t* cp16 = (uint16_t*) cp; … … 3355 3355 if( cp ) 3356 3356 { 3357 if( ur_encoding(tos) == UR_ENC_U TF16)3357 if( ur_encoding(tos) == UR_ENC_UCS2 ) 3358 3358 { 3359 3359 uint16_t* cp16 = (uint16_t*) cp; … … 3410 3410 if( str && start ) 3411 3411 { 3412 if( ur_encoding(tos) == UR_ENC_U TF16)3412 if( ur_encoding(tos) == UR_ENC_UCS2 ) 3413 3413 { 3414 3414 _trimStringUtf16( str, tos, str->ptr.u16, … … 3436 3436 if( str && start ) 3437 3437 { 3438 if( ur_encoding(tos) == UR_ENC_U TF16)3438 if( ur_encoding(tos) == UR_ENC_UCS2 ) 3439 3439 { 3440 3440 _trimIndentStringUtf16( str, tos, str->ptr.u16, trunk/thune/stdio.c
r458 r469 44 44 else if( ur_stringSlice(ut, tos, &it, &end) && it ) 45 45 { 46 if( ur_encoding(tos) == UR_ENC_U TF16)46 if( ur_encoding(tos) == UR_ENC_UCS2 ) 47 47 { 48 48 uint16_t* uit = (uint16_t*) it; trunk/thune/tests/working/encode.good
r233 r469 10 10 "helo" 11 11 --------- 12 u tf1612 ucs2 13 13 hello 14 14 "hello" trunk/thune/tests/working/encode.t
r458 r469 2 2 3 3 4 "hello" dup :a 'u tf16encode :uc4 "hello" dup :a 'ucs2 encode :uc 5 5 6 6 [ … … 32 32 33 33 test 34 str 'u tf16encode :str34 str 'ucs2 encode :str 35 35 test 36 36 trunk/thune/urlan.c
r468 r469 290 290 FIXED_ATOM( "ascii", 5, UR_ATOM_ASCII ) 291 291 FIXED_ATOM( "utf8", 4, UR_ATOM_UTF8 ) 292 FIXED_ATOM( "u tf16", 5, UR_ATOM_UTF16)292 FIXED_ATOM( "ucs2", 4, UR_ATOM_UCS2 ) 293 293 294 294 // File Options trunk/thune/urlan.h
r468 r469 111 111 #define UR_ENC_ASCII 0 112 112 #define UR_ENC_UTF8 1 113 #define UR_ENC_U TF162113 #define UR_ENC_UCS2 2 114 114 #define UR_ENC_COUNT 3 115 115 trunk/thune/urlan_atoms.h
r458 r469 38 38 #define UR_ATOM_ASCII 101 39 39 #define UR_ATOM_UTF8 102 40 #define UR_ATOM_U TF1610340 #define UR_ATOM_UCS2 103 41 41 #define UR_ATOM_BINARY 104 42 42 #define UR_ATOM_READ 105
