| OLD | NEW |
| 1 /* | 1 /* |
| 2 ******************************************************************************* | 2 ******************************************************************************* |
| 3 * | 3 * |
| 4 * Copyright (C) 2003-2009, International Business Machines | 4 * Copyright (C) 2003-2014, International Business Machines |
| 5 * Corporation and others. All Rights Reserved. | 5 * Corporation and others. All Rights Reserved. |
| 6 * | 6 * |
| 7 ******************************************************************************* | 7 ******************************************************************************* |
| 8 * file name: uidna.cpp | 8 * file name: uidna.cpp |
| 9 * encoding: US-ASCII | 9 * encoding: US-ASCII |
| 10 * tab size: 8 (not used) | 10 * tab size: 8 (not used) |
| 11 * indentation:4 | 11 * indentation:4 |
| 12 * | 12 * |
| 13 * created on: 2003feb1 | 13 * created on: 2003feb1 |
| 14 * created by: Ram Viswanadha | 14 * created by: Ram Viswanadha |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 | 401 |
| 402 //get the options | 402 //get the options |
| 403 //UBool useSTD3ASCIIRules = (UBool)((options & UIDNA_USE_STD3_RULES) != 0); | 403 //UBool useSTD3ASCIIRules = (UBool)((options & UIDNA_USE_STD3_RULES) != 0); |
| 404 int32_t namePrepOptions = ((options & UIDNA_ALLOW_UNASSIGNED) != 0) ? USPREP
_ALLOW_UNASSIGNED: 0; | 404 int32_t namePrepOptions = ((options & UIDNA_ALLOW_UNASSIGNED) != 0) ? USPREP
_ALLOW_UNASSIGNED: 0; |
| 405 | 405 |
| 406 // TODO Revisit buffer handling. The label should not be over 63 ASCII chara
cters. ICU4J may need to be updated too. | 406 // TODO Revisit buffer handling. The label should not be over 63 ASCII chara
cters. ICU4J may need to be updated too. |
| 407 UChar b1Stack[MAX_LABEL_BUFFER_SIZE], b2Stack[MAX_LABEL_BUFFER_SIZE], b3Stac
k[MAX_LABEL_BUFFER_SIZE]; | 407 UChar b1Stack[MAX_LABEL_BUFFER_SIZE], b2Stack[MAX_LABEL_BUFFER_SIZE], b3Stac
k[MAX_LABEL_BUFFER_SIZE]; |
| 408 | 408 |
| 409 //initialize pointers to stack buffers | 409 //initialize pointers to stack buffers |
| 410 UChar *b1 = b1Stack, *b2 = b2Stack, *b1Prime=NULL, *b3=b3Stack; | 410 UChar *b1 = b1Stack, *b2 = b2Stack, *b1Prime=NULL, *b3=b3Stack; |
| 411 int32_t b1Len, b2Len, b1PrimeLen, b3Len, | 411 int32_t b1Len = 0, b2Len, b1PrimeLen, b3Len, |
| 412 b1Capacity = MAX_LABEL_BUFFER_SIZE, | 412 b1Capacity = MAX_LABEL_BUFFER_SIZE, |
| 413 b2Capacity = MAX_LABEL_BUFFER_SIZE, | 413 b2Capacity = MAX_LABEL_BUFFER_SIZE, |
| 414 b3Capacity = MAX_LABEL_BUFFER_SIZE, | 414 b3Capacity = MAX_LABEL_BUFFER_SIZE, |
| 415 reqLength=0; | 415 reqLength=0; |
| 416 | 416 |
| 417 b1Len = 0; | |
| 418 UBool* caseFlags = NULL; | 417 UBool* caseFlags = NULL; |
| 419 | 418 |
| 420 UBool srcIsASCII = TRUE; | 419 UBool srcIsASCII = TRUE; |
| 421 /*UBool srcIsLDH = TRUE; | 420 /*UBool srcIsLDH = TRUE; |
| 422 int32_t failPos =0;*/ | 421 int32_t failPos =0;*/ |
| 423 | 422 |
| 424 // step 1: find out if all the codepoints in src are ASCII | 423 // step 1: find out if all the codepoints in src are ASCII |
| 425 if(srcLength==-1){ | 424 if(srcLength==-1){ |
| 426 srcLength = 0; | 425 srcLength = 0; |
| 427 for(;src[srcLength]!=0;){ | 426 for(;src[srcLength]!=0;){ |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 } | 911 } |
| 913 | 912 |
| 914 if(b2 != b2Stack){ | 913 if(b2 != b2Stack){ |
| 915 uprv_free(b2); | 914 uprv_free(b2); |
| 916 } | 915 } |
| 917 | 916 |
| 918 return result; | 917 return result; |
| 919 } | 918 } |
| 920 | 919 |
| 921 #endif /* #if !UCONFIG_NO_IDNA */ | 920 #endif /* #if !UCONFIG_NO_IDNA */ |
| OLD | NEW |