/*
*******************************************************************************
*
-* Copyright (C) 2002-2003, International Business Machines
+* Copyright (C) 2002-2010, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
}
c=src[j];
if(IS_BASIC(c)) {
+ cpBuffer[srcCPCount++]=0;
if(destLength<destCapacity) {
- cpBuffer[srcCPCount++]=0;
dest[destLength]=
caseFlags!=NULL ?
asciiCaseMap((char)c, caseFlags[j]) :
/* Represent delta as a generalized variable-length integer: */
for(q=delta, k=BASE; /* no condition */; k+=BASE) {
- /** RAM: comment out the old code for conformance with draft-ietf-idn-punycode-03.txt
+ /** RAM: comment out the old code for conformance with draft-ietf-idn-punycode-03.txt
t=k-bias;
if(t<TMIN) {
t=TMAX;
}
*/
-
+
t=k-bias;
if(t<TMIN) {
t=TMIN;
}
if(destLength<destCapacity) {
- dest[destLength++]=digitToBasic(t+(q-t)%(BASE-t), 0);
+ dest[destLength]=digitToBasic(t+(q-t)%(BASE-t), 0);
}
+ ++destLength;
q=(q-t)/(BASE-t);
}
if(destLength<destCapacity) {
- dest[destLength++]=digitToBasic(q, (UBool)(cpBuffer[j]<0));
+ dest[destLength]=digitToBasic(q, (UBool)(cpBuffer[j]<0));
}
+ ++destLength;
bias=adaptBias(delta, handledCPCount+1, (UBool)(handledCPCount==basicLength));
delta=0;
++handledCPCount;
/* Insert n at position i of the output: */
cpLength=UTF_CHAR_LENGTH(n);
- if((destLength+cpLength)<destCapacity) {
+ if((destLength+cpLength)<=destCapacity) {
int32_t codeUnitIndex;
/*