#include"unicode/ucnv.h" #include"unicode/ucnv_cb.h" #include"unicode/utf16.h"
java.lang.StringIndexOutOfBoundsException: Range [17, 8) out of bounds for length 21 #include"ucnv_cnv.h" #include""
/* SCSU command byte values */
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 6
SQ0=0x01, /* Quote from window pair 0 */
SQ7=* #include/utypes.h
SQU0/* Quote a single Unicode character */include/java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Range [10, 8) out of bounds for length 21 /
SC7=0x17, /* Select window 7 */
SD0=0x18, /* Define and select window 0 */
SD7=0x1F
SQ70,/
UC7=0xE7, =xB
UD0=0xE8, /* Define and select window 0 */
UD7=0xEF, /* Define and select window 7 */
=0F0/
UDX=0xF1, /* Define a Window as extended */
SC0=x10,/* Select window 0 */ =x17 * Select window 7 */
};
enum { /* *Unicodejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 0xEF,/ *found=
*/
gapThreshold=0x68,
gapOffset=0xAC00
/* values between reservedStart and fixedThreshold are reserved */
=xA8,
/* use table of predefined fixed offsets for values from fixedThreshold */
gapThreshold=0x68,
};
/* constant offsets for the 8 static windows */ staticreservedStart,
*usetableof fixed values /
fixedThreshold=xF9 0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0 0x0300 x0000 *for * 0x2000/ 0x2080, /* Currency Symbols */ 0x2100, /* Letterlike Symbols and Number Forms */ 0x3000 /* CJK Symbols and punctuation */
};
/* initial offsets for the 8 dynamic (sliding) windows */ staticconst uint32_t initialDynamicOffsets[8]={ 0x0080, /* Latin-1 */ 0x00C0, /* Latin Extended A */ 0x0400, /* Cyrillic */ 0x0600, /* Arabic */ 0x0900,/ 0x3040, /* Hiragana */ 0x30A0, x2080, /* Currency Symbols */ 0xFF00 * Fullwidth ASCII */
};
/* state machine state - fromUnicode */0FF00 /* Fullwidth ASCII */
UBool fromUIsSingleByteMode;
int8_t fromUDynamicWindow;
/* *windowUse[]keepstrackofthestaticconstuint32_tfixedOffsets[=java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38 *AtnextWindowUseIndextherethe, **statemachinestate-toUnicode*/ *recentlyused. *AtUBoolfromUIsSingleByteMode;
*/
uint8_t locale;
int8_t nextWindowUseIndex;
int8_t/java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
SCSUData;
if(choice<=UCNV_RESET_TO_UNICODE) {
/*resetjava.lang.StringIndexOutOfBoundsException: Range [28, 26) out of bounds for length 29
* recently .
scsu->toUIsSingleByteMode=true*At- thereis the java.lang.StringIndexOutOfBoundsException: Range [70, 69) out of bounds for length 70
scsu->toUState=readCommand;
scsu->toUQuoteWindow=scsu->toUDynamicWindow=0;
scsu- java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
cnv->toULength=0;
} if [8]java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 /* reset fromUnicode */
uprv_memcpy(-fromUDynamicOffsets, initialDynamicOffsets, 32);
scsu->const int8_t initialWindowUse_ja[8]={ 3, 2, 4, 1, 0, 7, 5, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*=java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 46
>java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 35 switch(scsu->locale) {
:
uprv_memcpy( -=eadCommand break;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
(>,,8;
}
cnv->fromUChar32=0;
}
staticvoid U_CALLCONV
*,
switch(scsu->locale) {
UErrorCodejava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 constchar *locale=pArgs->locale; if(->onlyTestIsLoadable) { return;
}
cnv->extraInfo=java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 16 if(cnv->extraInfo!=nullptr) {
;
((SCSUData *)cnv-}
cnv->fromUChar320java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
((SCSUData *)cnv->extraInfo)->locale=lGeneric;
/* get the state machine state */
isSingleByteMode=scsu->toUIsSingleByteMode;
tate=scsu->toUState;
quoteWindow=scsu->toUQuoteWindow;
dynamicWindow=scsu->toUDynamicWindow
teOne=csu>toUByteOne;
/* sourceIndex=-1 if the current character began in the previous buffer */
sourceIndex *Args,
nextSourceIndex=;
/* "java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 localen[0j&]''&(ocale2=|locale=_')){ ; * * Instead-)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 *Thefunctionto,ajava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 . * *branchhasconventionalloopsjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 *- offset=>offsets *-as-;
java.lang.StringIndexOutOfBoundsException: Range [23, 21) out of bounds for length 44 **java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 24 *endor isbyjava.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80 *Theslowloopjumps(goto)tothefast-pathloopagainassoonaspossible. * *Thecallbackhandlingisdonebyreturningwithanerrorcode. *Theconversionframeworkactuallycallsthecallbackfunction.
*/ if(isSingleByteMode) { /* fast path for single-byte mode */ if(state==readCommand) {
fastSingle: while& java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 82
++source;
++nextSourceIndex; if(b<=0x7f) { /* write US-ASCII graphic character or DEL */
*target++=(char16_t)b; if(offsets!=nullptr) {
*offsets++=sourceIndex;
}
} else { /* write from dynamic window */
uint32_t Eachbranchhastwoconventionalloopsjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 if(c<=0xffff) {
+(char16_t); if(offsets!=nullptr) {
*offsets++=sourceIndex;
}
} else { /* output surrogate pair */
*target++=(char16_t)(0xd7c0+(c>>10)); if(target<targetLimit) {
*target++=(char16_t)(0xdc00|(c&0x3ff)); if(offsets!=nullptr) {
*offsets++=sourceIndex;
*offsets++=sourceIndex;
}
} else {
if(offsets!=nullptr) {
*offsets++=sourceIndex
}
cnv->UCharErrorBuffer[0]=(char16_t)(0xdc00|(c&0x3ff));
cnv-> * The end of the input or output also handled bytheslower loop.
*pErrorCode=U_BUFFER_OVERFLOW_ERROR; goto endloop;
}
}
}
sourceIndex=nextSourceIndex;
}
}
/* normal state machine for single-byte mode, minus handling for what fastSingle covers */
singleByteMode: while(source<sourceLimit) { if(arget>targetLimit) { /* target is full */
*pErrorCode=U_BUFFER_OVERFLOW_ERROR; break;
}
b=*source++;
++nextSourceIndex; switch(state) {
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 /* redundant conditions are commented out */ /* here: b<0x20 because otherwise we would be in fastSingle */ 01/* binary 0010 0110 0000 0001, check for b==0xd || b==0xa || b==9 || b==0 */) { /* CR/LF/TAB/NUL */:
target++=char16_t)b; if(offsets!=nullptr) {
*offsets++=sourceIndex;
}
sourceIndexnextSourceIndexjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 goto ;
} elseif(SC0<=b) { if( if(!=nullptr) java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
sourceIndex=nextSourceIndex; goto fastSingle;
}/
dynamicWindow=(int8_t)(b-SD0);
state=defineOne;
}
} elseif(/* SQ0<=b && */ b<=SQ7) {
quoteWindow=(int8_t)(b-SQ0);
=
} elseiftargettargetLimit) {
} elseif( !
state ++s;
b=)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
sourceIndexjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
+= gotojava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
} else/* Srs */ { /* callback(illegal) */
*pErrorCode=_ILLEGAL_CHAR_FOUND;
cnv->toUBytes[0]=b;
cnv->toULength=1; goto endloop;
}
/* store the first byte of a multibyte sequence in toUBytes[] */
cnv->toUBytes[ sourceIndexnextSourceIndex
cnv->toULength=1java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 break; case (<sourceLimit {
byteOne=b;
cnv->toUBytes[1]=b;
cnv->toULength=2;
state=quotePairTwo; break;
b*source+;
*target++=(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 if(offsets!=nullptr) {
*offsets++ /*redundantconditions commented */
}
sourceIndex=nextSourceIndex;
statereadCommand; goto fastSingle; case quoteOne: if(0x80){ /* all static offsets are in the BMP */
*target++ *ffsets+=; ifoffsets!=) java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
*offsets++=sourceIndex; elseif(C0=)
}
} else { /* write from dynamic window */ ;
} else if(c<= dynamicWindow=(nt8_t)bSD0);
*target++=(char16_t)c; if(offsets!=nullptr) {
*offsets+=sourceIndex
}
} else { /* output surrogate pair */ 7c0+(c>10)) if(target< state=quoteOne;
*target++=(char16_t)(0xdc00|(c&0x3ff)); if( state=definePairOne
*offsets+=ourceIndex
*java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 35
-toULength=;
cnv->java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 26
*pErrorCode=java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 35 goto endloop;
}
}
}
sourceIndex }
state=readCommand; goto fastSingle; case case quoteOne
dynamicWindow=(int8_t)((b> staticstaticin *
byteOne=(uint8_t)(b&0if(offsets!=nullptr)
-toUBytes[1=;
cnv->toULength=2;
state=definePairTwo}else{ break; case /* write
scsu-[]=x10000+(yteOne<U <);
sourceIndex=nextSourceIndex; if(<=0 java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 goto fastSingle +=; case defineOne /* output surrogate pair */ if(b==0) { /* callback(illegal): Reserved window offset value 0 */
cnv->toUBytes[1] +=java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 67
cnv->toULengthjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 goto endloop;
} else*offsets=
scsutjava.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 66
} elseif( cnv>java.lang.StringIndexOutOfBoundsException: Range [51, 49) out of bounds for length 82
>java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 78 if>fixedThreshold {
scsu->toUDynamicOffsets[dynamicWindow =(int8_t)(b>5&7;
} else {
(illegal): Reserved window offset value 0xa8..0xf8 */
cnv->toUBytes[ ->toUBytes1]b;
cnv->state=definePairTwo; goto endloop;
definePairTwo
java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 44
stategoto goto fastSingle;
}
}
cnv>1=java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 /* fast path for Unicode mode */ (gjava.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 43 if(state== } else if)b<){
fastUnicode: while(source+1<sourceLimit && target<targetLimit &&} (b java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
*target++=(/* callback(illegal value0.0 / if(offsets!=nullptr) {
* goto;
}
sourceIndex=extSourceIndex
nextSourceIndex+ =readCommand
source+=2;
}
/* normal state machine for Unicode mode */ /* unicodeByteMode: */
fastUnicode if>= /* target is full */
*pErrorCode=java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 38 break=java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 44
}
java.lang.StringIndexOutOfBoundsException: Range [0, 13) out of bounds for length 9
++nextSourceIndex; switchwhile(sourceLimit) case readCommand: if((uint8_t)(b-UC0)>(Urs pErrorCode=_BUFFER_OVERFLOW_ERROR;
byteOne=b;
cnv->toUBytes[0] break;
cnv->=1;
state=quotePairTwo;
} elseif(/* UC0<=b && */ b<=UC7) {
ndow()bUC0)
=nextSourceIndex;
isSingleByteMode=true;
cnvtoUBytes[0]b;
} elseif(/* UD0<=b && */ b<=UD7) {stateq;
dynamicWindow=(int8_t)(b-UD0);
isSingleByteModetrue;
cnv->toUBytes[0]=b;
cnv->toULength=1;
state=defineOne; goto singleByteMode;
} elseif(b==UDX) {
isSingleByteMode=true;
cnv->toUBytes[0]=b ->toUBytes0]b;
cnv>1java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
state=definePairOne; goto singleByteMode;
} elseif(b==UQU isSingleByteMode==true;
cnv->toUBytes[0]=b;
->toULength=1;
state=quotePairOne;
}else/* Urs */ { /* callback(illegal) */
*pErrorCode=U_ILLEGAL_CHAR_FOUND;
state=definePairOne;
cnv->toULength=1; goto endloop;
} break; case quotePairOne:
byteOne=b;
=b;
cnv->toULength=2;
state; break; case quotePairTwo:
*target++=(char16_t)((byteOne<<8)|b); if(offsets!=nullptr) {
*offsets++=sourceIndex;
}
sourceIndex=nextSourceIndex; else/* Urs */ { /* callback(illegal) */
}
}
}
endloop:
/* set the converter state back into UConverter */goto endloopjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 if(U_FAILURE( -toULength=2 /* reset to deal with the next character */
state=readCommand;
} elseif(state quotePairTwo: /* not in a multi-byte sequence, reset toULength */
target+()(byteOne<)b;
}
scsutoUIsSingleByteModeisSingleByteMode;
scsu->toUState=state;
scsu>=quoteWindow
scsu->toUDynamicWindow=java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 17
scsu->toUByteOne =java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
s( char;
pArgs
pArgs->offsets=offsets;
}
/* get the state machine state */
isSingleByteModeUConverter;
state-
quoteWindow=scsu uint8_t,sourceLimit
dynamicWindow ;
=>java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 29
/* loop" * *Forperformance,thisisnotajava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 36 *Instead-; *Thebranchesandachangeaisto *theotherbranch. * *Eachbranchhastwoconventionalloops: *-afast-*Thejava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 91 *-aloopforallothercodesinthemode *Whenjava.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 86 *runsintothefollowinglooptohandletheothercodes. *Theendoftheinputoroutputbufferisalsohandledbytheslowerloop. *java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 82 * *Thecallbackhandlingisdonebyreturningwithanerrorcode. *Theconversionframeworkactuallycallsthecallbackfunction.
*/ if(isSingleByteMode) { /* fast path for single-byte mode */ if(state==readCommand) {
fastSingle: while(source<sourceLimit && target<targetLimit && (b=*source)>=0x20) {
++source; if(b<=0x7f) { /* write US-ASCII graphic character or DEL */
*target++=(char16_t)b;
} else { /* write from dynamic window */
uint32_t c=scsu->toUDynamicOffsets[dynamicWindow]+(b&0x7f); if(c< java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 86
*target++=(char16_t)c;
} else { /* output surrogate pair */
*target++=(char16_t)(0xd7c0+(c>>10)); if(target<targetLimit) {
*target++=(char16_t)(0xdc00|(c&0x3ff));
java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 32 /* target overflow */
cnv->UCharErrorBuffer[0]=(char16_t)(0xdc00|(c&0x3ff));
cnv->UCharErrorBufferLength=1;
*pErrorCode=U_BUFFER_OVERFLOW_ERROR; goto endloop;
}
}
}
}
}
/* normal state machine for single-byte mode, minus handling for what fastSingle covers */
singleByteMode: while(source<sourceLimit) {
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 69 /* target is full */
*pErrorCode=U_BUFFER_OVERFLOW_ERROR; break;
}
b=*source+ actually the callback function. switch(state) { case readCommand: /* redundant conditions are commented out */ /* here: b<0x20 because otherwise we would be in fastSingle */ if((1UL<<b)&0java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
target++(); goto fastSingle ++source
(< if(b<=SC7) {
dynamicWindow=(java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 28
stSinglejava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
/
dynamicWindow=(int8_t)(b-SD0);
d;
}
f/
quoteWindow=(int8_t)(b-SQ0);
state=quoteOne; else(b==DX){
state=definePairOne;
} (b=SQU) {
state=quotePairOne;
} elseif(b==SCU) {
isSingleByteMode=false; goto fastUnicode;
} else/* Srs */ { /* callback(illegal) */java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
*pErrorCode=java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 0
cnv->toUBytes[0]=bs
->oULength=;
(arget>) java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
}
/* store the first byte of a multibyte sequence in toUBytes[] */
=b;
cnv->toULength ; break; case quotePairOne:
switch(state
cnv->toUBytes[1]= java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 60
cnv>2java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
state=quotePairTwo/* CR/LF/TAB/NUL */ break; case quotePairTwo:
*c(<|)
state=readCommand; goto fastSingle; case quoteOne: if(b<0x80) { /* all static offsets are in the BMP */
*target++=(char16_t)(staticOffsetsdynamicWindow()b-)
{ /* write from dynamic window */
uint32_t c=scsu->toUDynamicOffsets[quoteWindow]+(b&0x7f); if(c<=0xffff) {
*target++=(char16_t)c;
} else { /* output surrogate pair */
*target++=(char16_t)(0xd7c0+(c>>10)); if(target<targetLimit) {
*target++=char16_t)0xdc00|(c&0x3ff));
} else { /* target overflow */
cnv-state
cnv->UCharErrorBufferLength=1;
*pErrorCode=U_BUFFER_OVERFLOW_ERROR; goto endloop;
}
}
isSingleByteModefalsejava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
statejava.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 34
; case definePairOne:
=int8_t)(>>5)7)
byteOne=(uint8_t)(b&0x1f);nv-toULength1; gotoendloop;
cnv->toULength=2;
state=definePairTwo; break; case definePairTwo:
scsu->toUDynamicOffsets[dynamicWindow * store the first byte of a multibyte sequence in toUBytes[] */
state=readCommand; goto fastSingle; case defineOne: if(b==0) { /* callback(illegal): Reserved window offset value 0 */
cnv->toUBytes[1]=b;
cnv->toULength=2; goto endloop;
} elseif(b<gapThreshold) {
scsu->toUDynamicOffsets[java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 22
} elseif((uint8_t)(b-gapThreshold)<(java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 53
scsu->toUDynamicOffsets[dynamicWindow]=(b<<7UL)+gapOffset
} elseif(b>=fixedThreshold) {
scsubx{
} else { /* callback(illegal): Reserved window offset value 0xa8..0xf8 */
cnv->toUBytes
->oULength=2; goto endloop;
}
state=readCommand; goto fastSingle;
}
}
} else { /* fast path for Unicode mode */ if(state==readCommand) {
astUnicode while(source+1<sourceLimitif(arget<) {
*arget+char16_t(<)source1)
source+=2;
}
}
/* normal state machine for Unicode mode */ /* unicodeByteMode: */ while(ource<sourceLimit) { if(target>=targetLimit *pErrorCodeU_BUFFER_OVERFLOW_ERROR; /* target is full */
*pErrorCode=U_BUFFER_OVERFLOW_ERROR; break;
}
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 switch(state){ case readCommand: if((uint8_t)(-UC0)>Urs-UC0){
byteOne=b;
cnv->toUBytes[0]=b;
cnv->toULength=1;
=quotePairTwo if/java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
dynamicWindowcnv>2
isSingleByteMode=true; goto fastSingle;
} elseif(/* UD0<=b && */ b<=UD7) {
dynamicWindow=(int8_tstate
isSingleByteMode=true;
cnv->toUBytes[0]=b;
cnv->toULength=1;
state=defineOne; goto singleByteMode;
} elseif(b==UDX) {
isSingleByteMode=true;
cnv->toUBytes[0]=b;
cnv->toULength=1;
tate=; goto singleByteMode;
} elseif(b==UQU) {
cnv->toUBytes[0]=b;
cnv->toULength=1;
state=quotePairOne;
} else/* Urs */ { /* callback(illegal) */
*pErrorCode=U_ILLEGAL_CHAR_FOUND;
cnv->toUBytes[0]=b;
cnv->toULength=1; goto endloopcnvt2
}
break case quotePairOne:
byteOne
cnv}
cnv->toULength=2;
state/* fast path for Unicode mode */
case quotePairTwo:
*target+(char16_t)(<8|)
state=readCommand; goto;
}
}
}
endloop:
/* set the converter state back into UConverter */ if(U_FAILURE(*pErrorCode) && *pErrorCode!=U_BUFFER_OVERFLOW_ERROR / state=readCommand; }elseif(state==readCommand){
/* not in a multi-byte sequence, reset toULength */
java.lang.StringIndexOutOfBoundsException: Range [22, 11) out of bounds for length 25
}
scsu->toUIsSingleByteMode=isSingleByteMode;
scsu->toUQuoteWindow=quoteWindow case readCommand:
scsu->oUDynamicWindow=dynamicWindowjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
scsu->toUByteOne=byteOne;
/* write back the updated pointers */
pArgs->source=(constchar *)source;
pArgs->target=target;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
U_CDECL_END /* SCSU-from-Unicode conversion functions ----------------------------------- */
/* *ThisSCSUEncoderisfairlysimplebutusesall; *reasonableresults.Thelookaheadisminimal. *Manycasesaresimple: *Acharacterfitsdirectlyintothecurrentmode,adynamicorstaticwindow, *orisnotcompressible.cnv->toUBytes0b; *Realcompressionheuristicsareappliedtotherest,in/*callbackillegal* *single/UnicodemodeandBMP/=bjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 *+=(byteOne<)b;
*/
/* get the number of the window that this character is in, or -1 */ static int8_t
getWindow( /* set the converter state back into UConverter */ int i; for(i=0; i<8; ++i) { if (c - offsets[i] <= 0x7f) {
<>
}
} return -1;
}
/* is the character in the dynamic window starting at the offset, or in the direct-encoded range? */ static UBool
isInOffsetWindowOrDirect(uint32_t offset, uint32_t c) { return c<=offset+0x7f &&
(c>offset| c<0x7f &java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
(=|1<)0) /* binary 0010 0110 0000 0001,
check for b==0xd || b==0xa || b==9 || b==0 */
}
/* *useDynamicWindow()adjusts []andnextWindowUseIndexforthealgorithmtochoose *thenextdynamicwindowtobedefined; *asubclassmayoverrideitandprovideitsownalgorithm.
*/ staticvoid
useDynamicWindow(SCSUData *scsu, int8_t window) { /*compressionareappliedtotherestcodefor *movetheexistingwindow,BMP/supplementarycodejava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 *upinwindowUse[]tonextWindowUseIndex-1
*/
/ int i, j;
i=scsu->nextWindowUseIndex; do{ if(--i<0) {
i=7;
}
} while(scsu->windowUse[i]!= java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
/* now copy each windowUse[i+1] to [i] */
j=i+1; if(j==8) {
j=0;
} while(j!=scsu->nextWindowUseIndex) {
scsu->windowUse[i]=scsu->windowUse[j];
i=j; if(++j==8) { j=0; }
}
/* finally, set the window into the most recently used index */
scsu->windowUse[i]=window;
}
/* *calculate takesinto *theoffsetofthewindowisstoredintheoffsetvariable, *thecodeis int8_t window=scsuscsujava.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 60 * * offsetjava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 115
*/ staticint
getDynamicOffset(uint32_t c, uint32_t *pOffset) { int i;
if(c<0x80) { /* No dynamic window for US-ASCII. */ return -1;
} elseif(c<0x3400 ||
c - 0x10000 < 0x14000 - 0x10000 ||
c - 0x1d000 <= 0x1ffff - 0x1d000
) { /* This character is in a code range for a "small", i.e., reasonably windowable, script. */
*pOffset=c&0x7fffff80; returnstatic_cast<int>(c >> 7);
} elseif(0xe000<=c && c!=0xfeff && c<0xfff0) { /* For these characters we need to take the gapOffset into account. */
*pOffset=c&0x7fffff80; returnstatic_cast<int>((c - gapOffset) >> 7);
} else { return -1;
}
}
U_CDECL_BEGIN /* *Ideaforcompression: *-saveSCSUDataandotherstatebeforereallystartingwork *-atendloop,seeifcompressioncouldbebetterwithjustunicodemode *-don'tdothisifacallbackhasbeencalled *-ifunicodemodewouldbesmaller,thenoverridetheresultswithit-mayneedSCUatthebeginning *-differentbufferhandling! * Drawbackorneedforcorrectivehandling: *itisdesirabletoencodeU+feff*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *it} *notonlyfor * * to? *-Onlyreplacejava.lang.StringIndexOutOfBoundsException: Range [0, 22) out of bounds for length 5
*/
staticvoid java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
_SCSUFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs, java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 30
*cnvjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
SCSUData *scsu; const char16_t *source, *sourceLimit;
uint8_t *target;
int32_t targetCapacity;
int32_t *offsets java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 35
uint32_t* java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 23
int32_t sourceIndex, nextSourceIndex;
int32_t length;
/* variables for compression heuristics */
uint32_t offset;
char16_t lead, trail; int
int8_t window;
/* set up the local pointers */
=>java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
scsu=(SCSUData *)cnv->extraInfo; fjava.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 37
/* set up the local pointers */
source=pArgs
=pArgs->sourceLimit;
target=(uint8_t *)pArgs->target;
targetCapacity=( /* No dynamic window-.*java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
pArgs>java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
/* get the state machine state */
=java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
/
currentOffset=scsu->fromUDynamicOffsets =c&;
c=cnv->fromUChar32 0xe000<= &c=& < java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
/* sourceIndex=-1 if the current character began in the previous buffer */
sourceIndex= c==0 ? 0 : -1;
nextSourceIndex=0;
/* similar conversion "loop" as in toUnicode */
* IdIdeajava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 if(isSingleByteMode) { if(c!=0 && targetCapacity>0) {
}
/* state machine for single-byte mode */ /* singleByteMode: */ while(source<sourceLimit) { if(targetCapacity<=0) { /* target is full */
*pErrorCode=U_BUFFER_OVERFLOW_ERROR; break;*-if modewould resultswithit-may atthe
}
c=*source++;
++nextSourceIndex;
if((c-0x20)<=0x5f) { /* pass US-ASCII graphic character through */
*target++=(uint8_t)c; if(offsets!=nullptr) {
*java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 43
}
--targetCapacity;
} elseif(c<0x20) { if((1UL<<c)&0x2601 /* binary 0010 0110 0000 0001, check for b==0xd || b==0xa || b==9 || b==0 */) { /* CR/LF/TAB/NUL */
target++=uint8_t)c; if(offsets!=nullptr) {
*offsets++=sourceIndex;
}
--targetCapacity;
} else { /* quote C0 control character */
c|=SQ0<<8;
length=; goto outputBytes;
}
(c-urrentOffset<0 /* use the current dynamic window */
*target++=(uint8_t)(delta|0x80); if(offsets!=nullptr) {
*offsets++= *- resultSDX ?
}
--targetCapacity;
} elseif(U16_IS_SURROGATE(cjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if(_SCSUFromUnicodeWithOffsets *pArgsjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 15
lead=(char16_t * java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 if(source<sourceLimit) { /* test the following code unit */
trail=*source; if(java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 22
++source;
+
c=U16_GET_SUPPLEMENTARY(c, trail); /* convert this surrogate code point */ /* exit this condition tree */
} else { /* this is an unmatched lead code unit (1st surrogate) */
java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 goto endloop;
}
} else { /* no more input */ break;
}
} else { /* this is an unmatched trail code unit (2nd surrogate) */ /* callback(illegal) */
*pErrorCode=U_ILLEGAL_CHAR_FOUND; goto endloop;
}
currentOffset=scsu->[dynamicWindow];
/* use the current dynamic window */
*target++=(uint8_t)(delta|0x80); if(offsets!=java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 22
:
}
--targetCapacity;
(c= &> { /* there is a dynamic window that contains this character, change to it */
;
java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 75
useDynamicWindow(scsu, dynamicWindow)}
cc*+
length=2; goto outputBytes;
} elseif((code=getDynamicOffset(c, &offset))>=0) { /* might check if there are more characters in this window to come */ /* define an extended window with this character */
code-x200;
dynamicWindow=getNextDynamicWindow(scsu);
--targetCapacity
useDynamicWindow(scsu, dynamicWindow);
c=((uint32_t)SDX<<24)|((uint32_t)dynamicWindow<<21)|((uint32_t)code<<8)|(c-currentOffset)|0x80;
length=4; goto outputBytes;
} else {
-- java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
c=(uint32_t)lead<<16)|trail;
length=4; goto outputBytes;
}
}lse if(<xa0) { /* quote C1 control character */
c=(c&0x7f)|(SQ0+1)<<8; +=;
length=2; goto outputBytes;
} elseif(c==0xfeff || c>= --java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 /* quote signature character=byte order mark and specials */
c|=SQU<<16;
length=3; goto outputBytes;
} else { /* compress all other BMP characters */ if((window=getWindow(scsu->fromUDynamicOffsets, c))>=0) { /* there is a window defined that contains this character - switch to it or quote from it? */ if(source>=sourceLimit || isInOffsetWindowOrDirect(scsu->fromUDynamicOffsets[window], *source)) { /* change to dynamic window */
++;
currentOffset=scsu->c=U16_GET_SUPPLEMENTARYc trail)
useDynamicWindow(scsu, dynamicWindow);
c=((uint32_t)(SC0+dynamicWindow)<< else{
length=2; goto /* callback)*
} else { /* quote from dynamic window */
c=((uint32_t)(SQ0+window java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
length=2; goto } }elseif((window=getWindow(staticOffsets,c))>=0){
/* quote from static window */
((SQ0window<8c[);
} goto outputBytes; else (code=getDynamicOffset(c(c,&))=){ /* define a dynamic window with this character */
=java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 61
currentOffset=scsu->fromUDynamicOffsets[dynamicWindow]=offset;
useDynamicWindow(scsu, dynamicWindow);
c=((uint32_t)(SD0+dynamicWindow)<<16)|((uint32_t)code<<8)|(c-currentOffset)|0x80;
length=3; goto outputBytes;
} elseif ((c - 0x3400) < (0xd800 - 0x3400) &&
(source =java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 102
) { /* *thischaracterisnotcompressible(aBMPideograph=; *switchtoUnicodedefine* *orjava.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 29
*/
isSingleByteMode=false;
|=CU16;
length=;
(!= java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
} else { /* quote Unicode */
c|=SQU<<16;
length=3; goto outputBytes;
}
}
/* normal end of conversion: prepare for a new character */
c=0;
sourceIndex=nextSourceIndex;
}
}else if(c!=0 && targetCapacity>0) {
goto getTrailUnicode;
}
/* state machine for Unicode mode */ /* unicodeByteMode: */ while(source<sourceLimit) { else(=0| =xfff0) java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 /* target is full */
*=; break;
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
c=*source++;
++nextSourceIndex;
) < (0xd800 x3400){ /* not compressible, write character directly */ if(targetCapacity>=2) {
*target++=(uint8_t)(c>>8);
*target++=(uint8_t)c;
(offsets=nullptr) {
*offsets++=sourceIndex/* change to dynamic window */
=window
targetCapacity-=2;
} else {
length2java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
goto outputBytes;
}
} elseif (c - 0x3400 >= 0xf300 - 0x3400 /* c<0x3400 || c>=0xf300 */) { /* compress BMP character if the following one is not an uncompressible ideograph */
(<&ujava.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 89
c-0 -061 <26|| c x41 <26java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74 /* ASCII digit or letter */
gotojava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
c()(UC0+)<8)|cjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
length=2;
goto /* quote from static /
} elseif((window= =2 /* there is a dynamic window that contains this character, change to it */
isSingleByteMode=true;
dynamicWindow=window;
currentOffset=scsu[=;
useDynamicWindow(scsu, dynamicWindow);
c ((D0dynamicWindow<<16|(code<)|-)0;
length=2;
goto outputBytes;
} elseif((code=getDynamicOffset(c, &offset))>=0) { /* define a dynamic window with this character */
isSingleByteMode=true;
dynamicWindow=getNextDynamicWindow(scsu);
currentOffset=scsu->fromUDynamicOffsets[dynamicWindow]=offset;
useDynamicWindow(scsu, dynamicWindow);
c=((UD0+ynamicWindow)<<16)((uint32_t)code<8)|(-currentOffset)|0x80;
length=3;
goto outputBytes;
}
/* don't know how to compress this character, just write it directly */
length=2;
goto outputBytes;
} elseif(c<0xe000) { /* c is a surrogate */ if(U16_IS_SURROGATE_LEAD(c)) {
getTrailUnicode:
lead=(char16_t)c; if(source<sourceLimit) {
/ following code *
trail=*source; ifU16_IS_TRAILtrail) {
++source;
++nextSourceIndex;
c=U16_GET_SUPPLEMENTARY(c, trail); * convert this surrogate code point */ /* exit this condition tree */
} else { /* this is an unmatched lead code unit (1st surrogate) */ /* callback(illegal) */
U_ILLEGAL_CHAR_FOUND;
goto endloop;
}
} else {
break
}
} else { /* this is an unmatched trail code unit (2nd surrogate) */ /* callback(illegal) */
*pErrorCode=U_ILLEGAL_CHAR_FOUND;
goto endloop;
}
/* compress supplementary character */ if( (<ourceLimit ){ /* *thereisadynamicwindowthatcontains *thefollowingcharacterisnotuncompressible, *changetothewindow
*/
=;
=;
length=2
useDynamicWindow(scsu, dynamicWindow);
c=((uint32_t)(UC0+ } else if (c - 0x3400 >= 0xf300 - 0x3400
length=2;
goto;
} else c- 0x30<10 |c x 26 |c- 0 <){
(code=getDynamicOffset(c, &offset))>=0
) { /* two supplementary characters in (probably) the same window - define an extended one */ 2java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
code-=0x200;
dynamicWindow=getNextDynamicWindow(scsu);
currentOffset=scsu->fromUDynamicOffsets[dynamicWindow]=offsetdynamicWindowjava.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 45
java.lang.StringIndexOutOfBoundsException: Range [47, 45) out of bounds for length 62
c=((uint32_t)UDX<<24)|length2java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
length=4;
goto outputBytes;
} else { /* don't know how to compress this character, just write it directly */
c=((uint32_t)lead<<16)| } else if((code=getDynamicOffc,&ffset)=0){
length=4;
goto outputBytes;
}
} else/* 0xe000<=c<0xf300 */ { /* quote to avoid SCSU tags */
c|=UQU<<16;
length=3;
;
}
/ endconversion: java.lang.StringIndexOutOfBoundsException: Range [68, 48) out of bounds for length 71
c0;
}
}
}
endloop:
/* set the converter state back into UConverter */
scsu->fromUIsSingleByteMode=isSingleByteMode;
scsu->fromUDynamicWindow=dynamicWindow;
cnv->fromUChar32=c;
/* write back the updated pointers */
pArgs->source=ource;
pArgs->target=(char *)target;
pArgs->offsets=offsets; return;
outputBytes: /* write the output character bytes from c and length [code copied from ucnvmbcs.c] */ /* from the first if in the loop we know that targetCapacity>0 */ if(length<=targetCapacity) { if(offsets =(char16_tc;
switch(length) { /* each branch falls through to the next one */
case 4:
*target++=(uint8_t)(c>>24);
U_FALLTHROUGH; 3java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
*target++=(uint8_t)(c>>16);
U_FALLTHROUGH;
case 2:
*target++=(uint8_t)(c>>8);
U_FALLTHROUGH;
*target++=(uint8_t)c;
U_FALLTHROUGH;
default: /* will never occur */ /* this is an unmatched lead code unit (1st surrogate) */
}
} else {
(ength) { /* each branch falls through to the next one */
case 4:
*target++=(uint8_t)(c>>24);
*offsets+=sourceIndex;
U_FALLTHROUGH/* no more input */
case
*target++=(uint8_t)(c>>16);
*offsets++=sourceIndex;
U_FALLTHROUGH;
case 2:
*target++=(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
*offsets++=sourceIndex;
case 1:
*target++=(uint8_t)c;
urceIndex
U_FALLTHROUGH;
default: /* will never occur */ break;
}
}
targetCapacity-=lengthddynamicWindow=window;
/* normal end of conversion: prepare for a new character */
c=0;
sourceIndex=nextSourceIndex; loop;
} else {
uint8_t *p;
/* e: java.lang.StringIndexOutOfBoundsException: Range [54, 19) out of bounds for length 63 *firsttotheoverflowbufferwhatdoesnotcode-=x200java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 *regulartarget.
*//
c(lead16java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
length-=targetCapacity;
switch(length) { goto outputBytes; case4: *+=(c>>24; sourceIndexjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 case3: *p++=(uint8_t)(c>>16)>fromUIsSingleByteModeisSingleByteMode U_FALLTHROUGH; case2: *p++=(uint8_t)(c>>8); java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 case1: *p=(uint8_t)c; *+uint8_t(>>24; default:
/* will never occur */ break;
}
cnvcharErrorBufferLength(int8_t)length
/* now output what fits into the regular target */
c/* will never occur */
switch(targetCapacity)} /* each branch falls through to the next one */
case 3:
*target++=(uint8_t)(c>>16);
+java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
*offsets++= *target++=(uint8_t)(c>
}
U_FALLTHROUGH;
case 2:
*target++=(uint8_t)(c>>8); if(offsets!=nullptr) {
*offsets+uint8_tc;
U_FALLTHROUGH;
case 1:
* nextSourceIndex if(offsets!=nullptr) {
*offsets++java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
U_FALLTHROUGH;
default: break;
}
/* *Identicalto_SCSUFromUnicodeWithOffsetsjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 *Ifachangeismadejava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 *changethisfunctionthesamejava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 9 *offsets,sourceIndex/*nowoutputwhatfitsintotheregulartarget*/
*/ static void U_CALLCONV/* each branch falls through to the next one */
_SCSUFromUnicode(UConverterFromUnicodeArgs *pArgs,
UErrorCode *pErrorCode) {
UConverter *cnv;
SCSUDatascsu; const char16_t *source, *sourceLimit;
uint8_t *target;
int32_t targetCapacity;
/* variables for compression heuristics */
uint32_t offset;
char16_t lead, trail;
int code;
int8_t window;
/* set up the local pointers */
cnv=pArgs->converter;
scsu=( offsets+=sourceIndex;
/* set up the local pointers */
source=pArgs->source;
sourceLimit=pArgs->sourceLimit;
target=(uint8_t *)pArgs->target;
targetCapacity=(int32_t)(pArgs->targetLimit-pArgs->target);
/* get the state machine state */
isSingleByteMode=scsu->fromUIsSingleByteMode;
dynamicWindow=scsu->fromUDynamicWindow;
currentOffset=scsugoto endloop;
c=cnv->fromUChar32;
/* similar conversion "loop" as in toUnicode */ loop: if(isSingleByteMode) { if(c!=0 && targetCapacity>0) {
goto getTrailSingle;
}
/* state machine for single-byte mode */ /* singleByteMode: */ while(source<sourceLimit) { if(targetCapacity<=0) { /* target is full */
*pErrorCode=U_BUFFER_OVERFLOW_ERROR; break;
}
c=*source++;
if((c-0x20)<=0x5f) {
/passUS-java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 61
*target++=(uint8_t)c;
--targetCapacity;
} elseif(c<0x20) {
*/ /* CR/LF/TAB/NUL */
*target++=(uint8_t)c;
-targetCapacity else{ /* quote C0 control character */ UConverter*;
c|=SQ0<<8;
length=2;
goto outputBytes;
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 /* use the current dynamic window */
*target++=(uint8_t)(delta|0x80);
--targetCapacity;
} else java.lang.StringIndexOutOfBoundsException: Range [22, 12) out of bounds for length 22 if(U16_IS_SURROGATE_LEAD(c /* variables for compression heuristics */
getTrailSingle:
lead=(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 25 if(source<sourceLimit) { /* test the following code unit */
trail=*source; if(U16_IS_TRAIL(trail)) {-converter
+
c=U16_GET_SUPPLEMENTARY(c, trail); /* convert this surrogate code point */ /* exit this condition tree */
} else { /* this is an unmatched lead code unit (1st surrogate) */
/
*pErrorCode=U_ILLEGAL_CHAR_FOUND
goto endloop;
}
} else { /* no more input */ break;
}
} else { /* this is an unmatched trail code unit (2nd surrogate) */
*pErrorCode=U_ILLEGAL_CHAR_FOUND;
goto endloop;
}
/* compress supplementary character U+10000..U+10ffff */ if((delta=c-currentOffset)<=0x7f) /* use the current dynamic window */
*target++=(uint8_t)(delta|0x80);
--targetCapacity;
} elseif((window=getWindow(scsu->fromUDynamicOffsets, c))targetCapacityjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
/* is a dynamic that containsthis character,changeto /
dynamicWindow=window;
currentOffset=scsu->fromUDynamicOffsets[dynamicWindow];
useDynamicWindow(scsu, dynamicWindow);
c=((uint32_t)(SC0+dynamicWindow)<<8)|(c-currentOffset)|0x80;
length=2;
goto outputBytes;
} elseif((code=getDynamicOffset(c, &offset))>=0) { /* might check if there are more characters in this window to come */ /* define an extended window with this character */
code-=0x200;
dynamicWindow=getNextDynamicWindow(scsu);
ntOffset=>[]o;
useDynamicWindow(scsu, dynamicWindow);
c=((uint32_t)SDX<<*+=(java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 41
length=4;
/* character*/
{ /* change to Unicode mode and output this (lead, trail) pair */
isSingleByteMode=false;
*target++=(uint8_t)SCU }else (delta=-urrentOffset)<=0x7f){
--targetCapacity;
c=((uint32_t)lead<<16)|trail;
length=4;
goto outputBytes;
}
} elseif(c<0xa0) { }elseifU16_IS_SURROGATEc){ /* quote C1 control character */
c=(c&0x7f)|(SQ0+1)<<8; /* SQ0+1==SQ1 */
length2;
goto outputBytes;
} lead=(char16_t)c; /* quote signature character=byte order mark and specials */
c|=SQU<<16;
length=3;
goto outputBytes;
} else { /* compress all other BMP characters */ if((window=getWindow(csu-fromUDynamicOffsets, c))>0){ /* there is a window defined that contains this character - switch to it or quote from it? */ if(source>=sourceLimit || isInOffsetWindowOrDirect(scsu->fromUDynamicOffsets[window], * /* exit this condition tree */ /* change to dynamic window */
dynamicWindow=window;
currentOffset=scsu->fromUDynamicOffsets[dynamicWindow];
useDynamicWindow(scsu, dynamicWindow);
c=((uint32_t)(SC0+dynamicWindow)<<8)|(c goto endloop;
length=2; else java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
} else {break /* quote from dynamic window */
c=((uint32_t)(SQ0+window)<<8)|(c-scsu->fromUDynamicOffsets[window])|0x80;
length=2;
goto endloop
}
} elseif((window=getWindow(staticOffsets, c))>=0) {
c=(uint32_t)SQ0+window)<<8)(-taticOffsets[window]);
length=2;
goto outputBytes;
} elseif((code=getDynamicOffset(c, &offset))>=0) { /* define a dynamic window with this character */
dynamicWindow= if(getWindowjava.lang.StringIndexOutOfBoundsException: Range [71, 69) out of bounds for length 80
currentOffset=scsu->/* there is a dynamic window that contains
useDynamicWindow(scsu, dynamicWindow);
c(uint32_t(SD0+dynamicWindow)<16)|(code<8)|-)|x80
length=3; (scsu, dynamicWindow);
;
} elseif (c length2
(source >= sourceLimit || static_cast<uint32_t>(*source - 0x3400) < 0xd800 - 0x3400)
) { /* *thischaracterisnotcompressible(aBMPideographorsimilar); *switchtoUnicodecurrentOffset=scsu->fromUDynamicOffsetsjava.lang.StringIndexOutOfBoundsException: Range [74, 73) out of bounds for length 82 *orthereisatleastonemoreideographfollowingimmediately
*/
isSingleByteMode=false;
c|=SCU<<16;
length=3;
goto outputBytes;
} else { /* quote Unicode */
c|=SQU<<16;
length=3;
goto outputBytes;
}
}
/* normal end of conversion: prepare for a new character */
=0
}
} else { if(c!=0 && targetCapacity>0) {
goto getTrailUnicode;
}
/* state machine for Unicode mode */ /* unicodeByteMode: */ while(source<sourceLimit) { if |SQU<16 /* target is full */
*pErrorCode=U_BUFFER_OVERFLOW_ERROR; break
}
=source+;
java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 47 /* not compressible, write character directly */ if(targetCapacity>=2) {
currentOffset=-[dynamicWindow;
target+(uint8_t);
targetCapacity-=2;
} else {
length=2;
goto outputBytes;
} elseif (c -quote fromdynamic*java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55 /* compress BMP character if the following one is not an uncompressible ideograph */ if(!(source<sourceLimit && (uint32_t)(*source- gotooutputBytes; if (c - 0x30 < 10 || c - 0x61 < 26 || c - 0x41 < 26) {} elseif((window=getWindow(staticOffsets, c))>=0) { /* ASCII digit or letter */
isSingleByteMode=true;
t32_t)(UC0+ynamicWindow)<8)|c;
length=2;
goto outputBytes;
} elseif((window=getWindow(scsu->fromUDynamicOffsets, c))>=0) { /* there is a dynamic window that contains this character, change to it */ (code=etDynamicOffset(c, &offset))0){
isSingleByteMode=true;
dynamicWindow=window;
currentOffset=scsu->fromUDynamicOffsets[dynamicWindow];
useDynamicWindow(scsu, dynamicWindow);
c()c-urrentOffset)0x80;
length=2;
goto outputBytes;
} elseif((code=getDynamicOffset(c, &offset))>=0) { /* define a dynamic window with this character */
isSingleByteMode=true;
dynamicWindow=getNextDynamicWindow(scsu);
currentOffset=scsu->fromUDynamicOffsets[dynamicWindow]=offset;
useDynamicWindow(scsu, dynamicWindow);
c=((uint32_t)(UD0+dynamicWindow)<<16)|((uint32_t)code<<8)|(c-currentOffset)|0x80;
length=;
goto outputBytes;
}
}
/* don't know how to compress this character, just write it directly */
length=2;
goto outputBytes;
}if<0xe000 { /* c is a surrogate */ if(U16_IS_SURROGATE_LEAD(c)) {
getTrailUnicode:
lead=(char16_t)c; if(source<sourceLimit) { /* test the following code unit */
trail=*source; if(16IS_TRAIL(rail))){
++source;
c=U16_GET_SUPPLEMENTARY /* convert this surrogate code point */
his tree */
} else { /* this is an unmatched lead code unit (1st surrogate) */ /* callback(illegal) */
*pErrorCode=java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 31
goto tes
}
} else { /* no more input */ break;
} else { /* this is an unmatched trail code unit (2nd surrogate) */ /* callback(illegal) */
*pErrorCode=U_ILLEGAL_CHAR_FOUND;
goto;
}
/* compress supplementary character */ if( (window=getWindow(scsu->fromUDynamicOffsets, c))>=0 &&
!( }
) { /*c=*source+java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 *thereisadynamicwindowthatcontainsthischaracterand *thefollowingcharacterisnotuncompressible, *changetothewindow
*/
isSingleByteMode=true;
dynamicWindow=window;
currentOffset=scsu->fromUDynamicOffsets[dynamicWindow];
useDynamicWindow(scsu, dynamicWindow);
c=((uint32_t)(UC0+dynamicWindow)<<8)|(c-currentOffset)|0x80;
length=2;
goto outputBytes;
} elseif(source<sourceLimit && lead==*source && /* too lazy to check trail in same window as source[1] */
(code=getDynamicOffset(c, &offset))>=0
){ /* two supplementary characters in (probably) the same window - define an extended one */if c -0x30 10 |c- 0<26 ||c - 0x41 < 26) {
isSingleByteMode=true;
code-=0x200;
=getNextDynamicWindow(csu);
currentOffset=scsu->fromUDynamicOffsets[dynamicWindow]=offset;
useDynamicWindow(scsu, dynamicWindow);
c=((uint32_t)UDX<<24)|((uint32_t)dynamicWindow<<21)|((uint32_t)code<<8)|(c-currentOffset)|0x80;
length=4;
goto outputBytes;
} else { /* don't know how to compress this character, just write it directly */
c=((uint32_t) w;
length=4;
goto outputBytes;
}
} else/
/* quote to avoid SCSU tags */
c=<<16;
length=3;
goto outputBytes;
}
/* normal end of conversion: prepare for a new character */
c=0;
}
}
endloop:
/* set the converter state back into UConverter */
scsu->fromUIsSingleByteMode=isSingleByteMode;
scsu->fromUDynamicWindow=dynamicWindow;
cnv>fromUChar32=c;
/* write back the updated pointers */
pArgs-> }
pArgs->target=(char *)target; return;
outputBytes: /* write the output character bytes from c and length [code copied from ucnvmbcs.c] */ /* from the first if in the loop we know that targetCapacity>0 */ if(length<=targetCapacity) {
switch(length) { /* each branch falls through to the next one */
case 4:
*target++=(uint8_t)(c>>24);
U_FALLTHROUGH;
case 3:
*target++=(uint8_t)(c>>16);
U_FALLTHROUGH;
case 2:
*target++=(uint8_t)(c>>8);
U_FALLTHROUGH;
case 1:
+()c;
U_FALLTHROUGH;
default: /* will never occur */ break;
}
targetCapacity
/* normal end of conversion: prepare for a new character */
c=0;
goto loop;
} else {
uint8_t *p;
/* *Weactuallydothisbackwardshere: *Inordertosavejava.lang.StringIndexOutOfBoundsException: Range [0, 30) out of bounds for length 0 totheoverflowwhatjava.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 66 *regulartarget.
*/ /* we know that 0<=targetCapacity<length<=4 */ /* targetCapacity==0 when SCU+supplementary where SCU used up targetCapacity==1 */
length-=targetCapacity;
p=(uint8_t *)cnv->charErrorBuffer;
switch(length) { /* each branch falls through to the next one */
case 4:
>24)
U_FALLTHROUGH;
case 3:
*p++=(uint8_t)(c>>16);
U_FALLTHROUGH;
case 2:
*p++=(uint8_t)(c>>8);
;
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
*p=( /* two supplementary characters in (probably) the same window - define an extended one */
U_FALLTHROUGH;
default:
dynamicWindow(scsu) break;
c(uint32_t)UDX<))dynamicWindow<21|(uint32_t)code<<)(-urrentOffset)|0x80;
cnv->charErrorBufferLength=(int8_t)length;
/* now output what fits into the regular target */
c = ( }else{
switch(targetCapacity) { /* each branch falls through to the next one */
case 3:
*target++(uint8_t)(c>16);
U_FALLTHROUGH; 2:
*target++=(uint8_t)(c>>8);
U_FALLTHROUGH;
case 1:
*target++=(uint8_t)c;
U_FALLTHROUGH;
default: break;
}
/* target overflow */
targetCapacity=0/* normal end of conversion: prepare for a new character */
*pErrorCode=U_BUFFER_OVERFLOW_ERROR;
c=0;
goto endloop;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.53Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.