Lines Matching +full:misleading +full:- +full:indentation
6 * Copyright (C) 2002-2011, International Business Machines
11 * encoding: UTF-8
13 * indentation:4
22 punycode.c 0.4.0 (2001-Nov-17-Sat)
35 redistributed derivative works do not contain misleading author or
41 * - ICU data types and coding conventions
42 * - ICU string buffer handling with implicit source lengths
44 * - UTF-16 handling
61 /* Punycode ----------------------------------------------------------------- */
91 * range 0 to BASE-1. The lowercase form is used unless the uppercase flag is
105 return (char)((_ZERO_-26)+digit); in digitToBasic()
111 * in the range 0 to BASE-1, or a negative value if cp is invalid.
117 return -1; in decodeDigit()
119 return cp-u'0'+26; // 0..9 -> 26..35 in decodeDigit()
122 return cp-u'A'; // A-Z -> 0..25 in decodeDigit()
125 return cp-'a'; // a..z -> 0..25 in decodeDigit()
127 return -1; in decodeDigit()
135 b-=(_SMALL_A-_CAPITAL_A); in asciiCaseMap()
139 b+=(_SMALL_A-_CAPITAL_A); in asciiCaseMap()
145 /* Punycode-specific Bootstring code ---------------------------------------- */
148 * The following code omits the {parts} of the pseudo-algorithm in the spec
164 for(count=0; delta>((BASE-TMIN)*TMAX)/2; count+=BASE) { in adaptBias()
165 delta/=(BASE-TMIN); in adaptBias()
168 return count+(((BASE-TMIN+1)*delta)/(delta+SKEW)); in adaptBias()
173 // ICU-13727: Limit input length for n^2 algorithm
174 // where well-formed strings are at most 59 characters long.
196 if(src==NULL || srcLength<-1 || (dest==NULL && destCapacity!=0)) { in u_strToPunycode()
207 * convert extended ones to UTF-32 in cpBuffer (caseFlag in sign bit): in u_strToPunycode()
210 if(srcLength==-1) { in u_strToPunycode()
211 /* NUL-terminated input */ in u_strToPunycode()
245 /* length-specified input */ in u_strToPunycode()
274 /* Finish the basic string - if it is not empty - with a delimiter. */ in u_strToPunycode()
297 * All non-basic code points < n have been handled already. in u_strToPunycode()
311 if(m-n>(0x7fffffff-handledCPCount-delta)/(handledCPCount+1)) { in u_strToPunycode()
315 delta+=(m-n)*(handledCPCount+1); in u_strToPunycode()
324 /* Represent delta as a generalized variable-length integer: */ in u_strToPunycode()
327 … /** RAM: comment out the old code for conformance with draft-ietf-idn-punycode-03.txt in u_strToPunycode()
329 t=k-bias; in u_strToPunycode()
337 t=k-bias; in u_strToPunycode()
349 dest[destLength]=digitToBasic(t+(q-t)%(BASE-t), 0); in u_strToPunycode()
352 q=(q-t)/(BASE-t); in u_strToPunycode()
387 if(src==NULL || srcLength<-1 || (dest==NULL && destCapacity!=0)) { in u_strFromPunycode()
392 if(srcLength==-1) { in u_strFromPunycode()
409 if(src[--j]==DELIMITER) { in u_strFromPunycode()
417 b=src[--j]; in u_strFromPunycode()
448 * Decode a generalized variable-length integer into delta, in u_strFromPunycode()
464 if(digit>(0x7fffffff-i)/w) { in u_strFromPunycode()
471 /** RAM: comment out the old code for conformance with draft-ietf-idn-punycode-03.txt in u_strFromPunycode()
472 t=k-bias; in u_strFromPunycode()
479 t=k-bias; in u_strFromPunycode()
489 if(w>0x7fffffff/(BASE-t)) { in u_strFromPunycode()
494 w*=BASE-t; in u_strFromPunycode()
503 bias=adaptBias(i-oldi, destCPCount, (UBool)(oldi==0)); in u_strFromPunycode()
509 if(i/destCPCount>(0x7fffffff-n)) { in u_strFromPunycode()
536 * This is handled with the same efficiency as with UTF-32. in u_strFromPunycode()
539 * more slowly - but not too bad since this is an insertion anyway. in u_strFromPunycode()
550 U16_FWD_N(dest, codeUnitIndex, destLength, i-codeUnitIndex); in u_strFromPunycode()
557 (destLength-codeUnitIndex)*U_SIZEOF_UCHAR); in u_strFromPunycode()
561 destLength-codeUnitIndex); in u_strFromPunycode()
574 caseFlags[codeUnitIndex]=IS_BASIC_UPPERCASE(src[in-1]); in u_strFromPunycode()
588 /* ### check notes on overflow handling - only necessary if not IDNA? are these Punycode functions …