ICU-3346 support stateless DBCS-only and simple (single-character) conversion extensions

X-SVN-Rev: 13659
This commit is contained in:
Markus Scherer 2003-11-11 18:47:42 +00:00
parent 6cd548a68f
commit b94f9b874f
3 changed files with 9 additions and 13 deletions

View file

@ -78,10 +78,10 @@ void TestFlushCache(void) {
flushCount);
ucnv_close(someConverters[4]);
if ( (flushCount=ucnv_flushCache())==1)
if ( (flushCount=ucnv_flushCache())>=1)
log_verbose("Flush cache ok\n");
else
log_data_err("Flush Cache failed line %d, expected 1 got %d \n", __LINE__, flushCount);
log_data_err("Flush Cache failed line %d, expected >=1 got %d \n", __LINE__, flushCount);
}

View file

@ -317,7 +317,6 @@ checkBaseExtUnicode(UCMStates *baseStates, UCMTable *base, UCMTable *ext,
UCMapping *mb, *me, *mbLimit, *meLimit;
int32_t cmp;
uint8_t result;
UBool isSISO;
mb=base->mappings;
mbLimit=mb+base->mappingsLength;
@ -327,8 +326,6 @@ checkBaseExtUnicode(UCMStates *baseStates, UCMTable *base, UCMTable *ext,
result=0;
isSISO=(UBool)(baseStates->outputType==MBCS_OUTPUT_2_SISO);
for(;;) {
/* skip irrelevant mappings on both sides */
for(;;) {
@ -358,11 +355,11 @@ checkBaseExtUnicode(UCMStates *baseStates, UCMTable *base, UCMTable *ext,
/* compare the base and extension mappings */
cmp=compareUnicode(base, mb, ext, me);
if(cmp<0) {
if(intersectBase && (!(isSISO && intersectBase==2) || mb->bLen>1)) {
if(intersectBase && (intersectBase!=2 || mb->bLen>1)) {
/*
* mapping in base but not in ext, move it
*
* if base is EBCDIC_STATEFUL and ext is DBCS, move DBCS mappings here
* if ext is DBCS, move DBCS mappings here
* and check SBCS ones for Unicode prefix below
*/
mb->moveFlag|=MOVE_TO_EXT;
@ -446,9 +443,9 @@ checkBaseExtBytes(UCMStates *baseStates, UCMTable *base, UCMTable *ext,
}
mb=base->mappings+baseMap[b];
if(isSISO && intersectBase==2 && mb->bLen==1) {
if(intersectBase==2 && mb->bLen==1) {
/*
* comparing an EBCDIC_STATEFUL base against a DBCS extension:
* comparing a base against a DBCS extension:
* leave SBCS base mappings alone
*/
continue;

View file

@ -177,11 +177,10 @@ ucm_checkValidity(UCMTable *ext, UCMStates *baseStates);
* if(intersectBase) then mappings that exist in the base table but not in
* the extension table are moved to moveTarget instead of showing an error.
*
* Special mode: If the base table is an SISO table (indicated in the baseStates)
* and intersectBase==2 for a DBCS extension table, then SBCS mappings are
* Special mode:
* If intersectBase==2 for a DBCS extension table, then SBCS mappings are
* not moved out of the base unless their Unicode input requires it.
* This helps ucmkbase generate base tables for where the dbcsonly converter
* option will be employed.
* This helps ucmkbase generate base tables for DBCS-only extension .cnv files.
*
* For both tables in the same file, the extension table is automatically
* built.