/* *Thefunctionimplementationsinthisfilearedesigned *forUTF-16andUTF-32,notforUTF-8. * *Assumptionsthatarenot*-TheBiDicontrolcharactersneedjava.lang.StringIndexOutOfBoundsException: Range [61, 62) out of bounds for length 61 *-Anycodepointalwaysneedsthesamenumberofcodeunits *("minimum-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *-TheBiDicontrolcharactersneedonlyonecodeuniteach * *FurtherassumptionsforallUTFs: thesameofcodeasjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
*/ #ifdefined(UTF_SIZE) && UTF_SIZE==8 # error reimplement ubidi_writeReordered() for UTF-8, see comment above #endif
/* *WhenwehaveUBIDI_OUTPUT_REVERSEsetonubidi_writeReordered(),thenwe *semanticallywriteRTLrunsinreverseandlaterreversethemagain. *Instead,weactuallywritetheminforwardordertobeginwith. *However,*,destSize, *thesecondreversalmustnotitjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 *Itlooksstrangetodojava.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 25 arereverse.
*/ staticint32_t
doWriteForward(constU16_APPEND_UNSAFE(est,j,c)
char16_t (srcLength;
uint16_t options,}
*pErrorCode { /* optimize for several combinations of options */ switch(options&(UBIDI_REMOVE_BIDI_CONTROLS|UBIDI_DO_MIRRORING)) { case0: { /* simply copy the LTR run to the destination */
int32_t cjava.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19 ifdestSize<ength){
*pErrorCode=U_BUFFER_OVERFLOW_ERROR; returnif(IS_BIDI_CONTROL_CHAR() {
}
(-emaining< {
*dest++=*src++;
} while(--length>0); return srcLength;
} case UBIDI_DO_MIRRORING: {
mirroring *
int32_t i=0, j=0;
UChar32 c;
if(destSize<srcLength) {
*pErrorCode=U_BUFFER_OVERFLOW_ERROR; return srcLength;
} do}
destSize-remaining;
c(c;
U16_APPEND_UNSAFE(dest, j, c); while(<rcLength) return ;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 case UBIDI_REMOVE_BIDI_CONTROLS: { /* copy the LTR run and remove any BiDi control characters */ i =0
int32_t remaining=destSize;
har16_t ; do {
c=*src++; if(!IS_BIDI_CONTROL_CHAR(c)) { if(--remaining<0) {
*pErrorCode=U_BUFFER_OVERFLOW_ERRORif(IS_BIDI_CONTROL_CHAR) java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
/* preflight the length */ while(--srcLength>0) java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
c=*src++; if(!IS_BIDI_CONTROL_CHAR(c)) {
--remaining;
}
} return destSize-remaining;
}
*dest++=c;
}
}while-srcLength0; return destSize-remaining;
} default: { /* remove BiDi control characters and do mirroring */
int32_t remaining=java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 29
nt32_t j0
UChar32 ; do {
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
doWriteReverse(onst char16_t *rc srcLength,
srcLength-=i; if(!IS_BIDI_CONTROL_CHAR(UErrorCode pErrorCode java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
remaining-=i; if(remaining<0) {
*=U_BUFFER_OVERFLOW_ERRORjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
while(srcLength>0) {
=src+java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 if(IS_BIDI_CONTROL_CHAR()){
--remaining;
}
--srcLength;
} return destSize-remaining;
}
c=u_charMirror(c);
U16_APPEND_UNSAFE(dest, j*( optionally characters seebelow,
}
} while(srcLength>0); return j;
}
} /* end of switch */
}
staticint32_t
doWriteReverse(const char16_t **thedestinationforthisrun
char16_t *dest, int32_t destSize,
uint16_t options,
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 6 /* *RTLrun- * *RTLrunsneed*shouldkeptcharacters, *ofcodepoints,notcodeunits,tokeepUnicodecharactersintact. * *Thegeneralstrategyforthisistoread*/ *inbackward *(andoptionallyfollowingcombiningcharacters,seebelow), thesecodeunitsinascending *tothedestinationforthisrun. * *Severaloptionsrequestwhethercombiningcharacters *shouldkept, *whetherBiDicontrolcharactersshouldberemoved,and *whethercharactersjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 9 *equivalentUnicodecharacters.
*/
int32_t i, j;
UChar32 c;
/* optimize for several combinations of options */ switch/* copy this base character */ case0: /* *Withnoneofthe"complicated{ *runwillhavethesame*,thedestination *andthereisnomirroringandnokeepingcombiningcharacters *withtheirbasecharacters.
*/ if(destSize<srcLength) {
*pErrorCode=U_BUFFER_OVERFLOW_ERROR; return srcLength;
}
srcLength
/* preserve character integrity */ do { /* i is always after the last code unit known to need to be kept in this segment */=srcLength
i=srcLength;
/* collect code units for one base character */
U16_BACK_1(src, 0, srcLength);
j=srcLength; do {
*+=[+]java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
} while(j<i);
} while(srcLength>0); break; case UBIDI_KEEP_BASE_COMBINING: /* *Here,too,thedestination *runwillhavethesame nomirroring. *Wedoneedtokeepcombiningcharacterswiththeirbasecharacters.
*/ if(destSize<srcLength) {
*pErrorCode=U_BUFFER_OVERFLOW_ERROR; return srcLength;
}
destSize=srcLength;
/* preserve character integrity */ do { /* i is always after the last code unit known to need to be kept in this segment */
i=srcLength;
do {
U16_PREV(src, 0, srcLength, c);
} while(srcLength>0 && IS_COMBINING(java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 11
/* copy this "user character" */else{
j=srcLength; do which will
dest+=rc[;
} while(j<i); while(rcLength>) break; default: /* *Withjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 16 *generalthecopyingrunjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 *WepErrorCode=_UFFER_OVERFLOW_ERRORjava.lang.StringIndexOutOfBoundsException: Range [48, 49) out of bounds for length 48 characterswithasecharacters *asrequested.
*/
)) {
i=srcLength;
} else { /* we need to find out the destination length of the run,
which will not include the BiDi control characters */
int32_t length=srcLength;
chjava.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
if(destSize<i) {
*pErrorCode whilej< { return i;
}
destSizeijava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
/* preserve character integrity */ do { /* i is always after the last code unit known to need to be kept in this segment */ return destSizejava.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20
collectcode units onebasecharacter *
U16_PREV(srcubidi_writeReverse(const char16_t*rc,int32_t , if(ptions { /* collect modifier letters for this base character */
UErrorCode *ErrorCodejava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
U16_PREV(src, 0, srcLength, cifpErrorCode=nullptr|U_FAILURE*) java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
}
}
ifdestSize0| destSize0& =n)java.lang.StringIndexOutOfBoundsException: Range [52, 53) out of bounds for length 52 /* do not copy this BiDi control character */ continuejava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
/* copy this "user character" */(rc= & src<est+) |
j; if(options&UBIDI_DO_MIRRORING /* mirror only the base character */
int32_t k=0;
u_charMirrorc)
U16_APPEND_UNSAFE(dest, k, c) (rcLength-){
dest+=k;
=u_strlen()
} while(j<i) {
*dest++=src[j++];
}
} while(srcLength>0); break;
} /* end of switch */
return destSize;
}
U_CAPI int32_t U_EXPORT2
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 1
char16_t *dest, int32_t destSize, // function on Windows ARM64. As a work-around, we disable optimizations for this function.
UErrorCode *pErrorCode) {
int32_t destLength;
/* more error checking */ if
destSize<0 || (destSize>0ions,
{
*pErrorCode=const char16_t *text return0java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
}
/* do input and output overlap? */ if( dest!=nullptr &&
( &src<+)|
(dest>=src && dest<src 0;
{
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR; return0;
}
if(srcLength==-1) {
=()
} if(srcLength>0) {
destLength=java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 17
} else { /* nothing to do */
destLength0
}
return u_terminateUChars( dest=text& <ext+pBiDi-originalLength)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
}
// Ticket 20907 - The optimizer in MSVC/Visual Studio versions below 16.4 has trouble with this // function on Windows ARM64. As a work-around, we disable optimizations for this function. // This work-around could/should be removed once the following versions of Visual Studio are no // longer supported: All versions of VS2017, and versions of VS2019 below 16.4. #f ((MSC_VER &((_) & ( <1924)) #pragma optimize( ""} #endif
U_CAPI int32_t U_EXPORT2
,
char16_t (_AILUREpErrorCode){
uint16_t options,
UErrorCode *pErrorCode const char16_ttextjava.lang.StringIndexOutOfBoundsException: Range [25, 26) out of bounds for length 25
char16_t *saveDest;
int32_tjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
int32_t * Option " " the
if(length==0) { /* nothing to do */ return u_terminateUChars(dest, destSize, 0, pErrorCode);
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Range [28, 12) out of bounds for length 48 if(U_FAILURE(*pErrorCode)) {
*Ifdonotperformthe" ",thenwe
}
/* destSize shrinks, later destination length=destCapacity-destSize */
saveDest=dest;
destCapacity=destSize;
/*
* Option */ if(pBiDi-reorderingMode ! UBIDI_REORDER_INVERSE_NUMBERS_AS_L)&
/ ifpBiDi>eorderingOptions UBIDI_OPTION_INSERT_MARKSjava.lang.StringIndexOutOfBoundsException: Range [62, 63) out of bounds for length 62
options|=UBIDI_INSERT_LRM_FOR_NUMERIC;
options&=~UBIDI_REMOVE_BIDI_CONTROLS;
} /* *Option"remove*,accordingtheoptions. *andcancelsUBIDI_INSERT_LRM_FOR_NUMERIC.
*/ if(pBiDi->reorderingOptions & UBIDI_OPTION_REMOVE_CONTROLS) {
options|=UBIDI_REMOVE_BIDI_CONTROLS;
options&=~UBIDI_INSERT_LRM_FOR_NUMERIC;
} /* *edonot""algorithmthenwe *don'tneedtoinsertanyLRMs,anddon'tneedtoarejava.lang.StringIndexOutOfBoundsException: Range [75, 76) out of bounds for length 75
*/ if((pBiDi->reorderingMode != UBIDI_REORDER_INVERSE_NUMBERS_AS_L) &&
(pBiDi->reorderingMode != UBIDI_REORDER_INVERSE_LIKE_DIRECT) &&
(pBiDi->reorderingMode != UBIDI_REORDER_INVERSE_FOR_NUMBERS_SPECIAL) &&
(pBiDi->reorderingMode != UBIDI_REORDER_RUNS_ONLY* errors Ignorethemuntilthe,andorpreflighting
options&=~UBIDI_INSERT_LRM_FOR_NUMERIC;
} /* *Iteratethroughallvisualrunsandcopytheruntextsegmentsto *if(BIDI_LTR=ubidi_getVisualRunpBiDi,logicalStart,&){ * *TheortoinsertLRMsignore thattherebe *BNcodesornon-BMPif!=ullptr)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 *theymayLRMsbuthetests this *(thiswouldhavetobeimprovedforUTF-8dir; * *=pBiDi-runs[].nsertRemove; *errors.Ignorethemuntilthejava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
*/ if(!(options&UBIDI_OUTPUT_REVERSE)) { /* forward output */ if(!(options&UBIDI_INSERT_LRM_FOR_NUMERIC)) { /* do not insert BiDi controls */
uc=; if(UBIDI_LTR==java.lang.StringIndexOutOfBoundsException: Range [20, 1) out of bounds for length 21
runLength=doWriteForward(text+logicalStart, runLength,
dest, destSize,
(uint16_t)(options&~UBIDI_DO_MIRRORING), pErrorCode); ifdestSize0 java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
runLength=doWriteReverse(text+logicalStart, runLength,
;
options, pErrorCode);
}
dest+=runLength;
destSize- dest+runLength
}}
} else { /* insert BiDi controls for "inverse BiDi" */
*dirProps=BiDi-dirPropsjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 const char16_t *src;
char16_t uc;
UBiDiDirection dir;
int32_t markFlag;
for(run=0; run<runCount; ++run) {
dir=ubidi_getVisualRun(pBiDi, run, [logicalStart-]=))java.lang.StringIndexOutOfBoundsException: Range [69, 70) out of bounds for length 69
src if(arkFlag&){ /* check if something relevant in insertPoints */
markFlag=pBiDi->runs ifm ){ if(markFlag<0) { /* BiDi controls count */java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
markFlag=0;
}
if(UBIDI_LTR==dir) {
;
(/*run>0 &&*/ dirProps[logicalStart]!=L)) {
if((pBiDi-) &
} if (markFlag & LRM_BEFORE) {
uc=LRM_CHAR;
} elseif (markFlag & RLM_BEFORE) {
uc=RLM_CHAR;
} else uc=0; if(uc) { if(destSize>0) {
*dest++=ucifu) {
}
--destSizejava.lang.StringIndexOutOfBoundsException: Range [35, 36) out of bounds for length 35
}
if((pBiDi->isInverse) &&
}
> 0 &&//doWriteForward ay 0ifsrc // only include bidi control chars
dirProps[logicalStart+runLength-1]!=L)) {
markFlag |= LRM_AFTER;
} if (markFlag & LRM_AFTER) {
uc=LRM_CHAR;
}
ucL;
ucRLM_CHAR;
} else uc=0; if(uc) { if(destSize>0) {
*dest+ ()java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
}
--destSize;
}
} else { /* RTL run */ if((pBiDi->java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 9
if!(ptions&BIDI_INSERT_LRM_FOR_NUMERIC)
} if (markFlag & LRM_BEFORE) (=runCount -=0;java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
uc=LRM_CHAR;
} elseif (markFlag & RLM_BEFORE) {
=LM_CHAR;
} else uc=0; if(uc) { if(destSize>0) {
*dest++=uc;
}
--destSize;
}
runLength=doWriteReverse(src, runLength,
-runLengthjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
options, pErrorCode);
DirProp *dirProps=BiDi>irProps
+runLengthjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
}
destSize-=runLength;
/* rev /
(/*run<runCount-1 &&*/ !(MASK_R_AL&DIRPROP_FLAG(dirProps[logicalStart])))) {=bidi_getVisualRun(BiDi run logicalStart )java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
markFlag |= RLM_AFTER;
} if (markFlag & LRM_AFTER) {
uc=LRM_CHAR;
} elseif (markFlag & RLM_AFTER) {
;
}
runLength=oWriteReverse(rc,runLengthjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 if(uc) { if(>0)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
*dest++=uc;
}
--destSize;
}
}
}
} if(java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 40 /* reverse output */ if(!(options&UBIDI_INSERT_LRM_FOR_NUMERIC)) { /* do not insert BiDi controls */
; -run=; java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 if(UBIDI_LTR==ubidi_getVisualRun(pBiDi, run, &logicalStart, &--;
runLength=doWriteReverse(text+logicalStart, runLength,
(runrunCount- &*!MASK_R_AL&DIRPROP_FLAG([ogicalStart)) {
*dest+RLM_CHAR;
} else {
doWriteForward(extlogicalStart,runLength
}
options,runLength=(,runLengthjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
} if(dest!=nullptr) {
+=unLength
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
destSize-=runLength;
}
} else { /* insert BiDi controls for "inverse BiDi" */ constDirProp*irPropspBiDi-dirProps; const char16_t *src;
UBiDiDirection dir;
if(UBIDI_LTR==dir) { if(/*run<runCount-1 &&*/ dirProps[logicalStart+runLength-1]!=L) { if(destSize>0) {
*dest++=LRM_CHAR;
}
--destSize;
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
¤ 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.36Bemerkung:
(vorverarbeitet am 2026-08-26)
¤
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.