michael@0: /* michael@0: ***************************************************************************** michael@0: * Copyright (C) 1996-2011, International Business Machines Corporation and * michael@0: * others. All Rights Reserved. * michael@0: ***************************************************************************** michael@0: */ michael@0: michael@0: #include "unicode/utypes.h" michael@0: michael@0: #if !UCONFIG_NO_NORMALIZATION michael@0: michael@0: #include "unicode/caniter.h" michael@0: #include "unicode/normalizer2.h" michael@0: #include "unicode/uchar.h" michael@0: #include "unicode/uniset.h" michael@0: #include "unicode/usetiter.h" michael@0: #include "unicode/ustring.h" michael@0: #include "unicode/utf16.h" michael@0: #include "cmemory.h" michael@0: #include "hash.h" michael@0: #include "normalizer2impl.h" michael@0: michael@0: /** michael@0: * This class allows one to iterate through all the strings that are canonically equivalent to a given michael@0: * string. For example, here are some sample results: michael@0: Results for: {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D}{COMBINING DOT ABOVE}{COMBINING CEDILLA} michael@0: 1: \u0041\u030A\u0064\u0307\u0327 michael@0: = {LATIN CAPITAL LETTER A}{COMBINING RING ABOVE}{LATIN SMALL LETTER D}{COMBINING DOT ABOVE}{COMBINING CEDILLA} michael@0: 2: \u0041\u030A\u0064\u0327\u0307 michael@0: = {LATIN CAPITAL LETTER A}{COMBINING RING ABOVE}{LATIN SMALL LETTER D}{COMBINING CEDILLA}{COMBINING DOT ABOVE} michael@0: 3: \u0041\u030A\u1E0B\u0327 michael@0: = {LATIN CAPITAL LETTER A}{COMBINING RING ABOVE}{LATIN SMALL LETTER D WITH DOT ABOVE}{COMBINING CEDILLA} michael@0: 4: \u0041\u030A\u1E11\u0307 michael@0: = {LATIN CAPITAL LETTER A}{COMBINING RING ABOVE}{LATIN SMALL LETTER D WITH CEDILLA}{COMBINING DOT ABOVE} michael@0: 5: \u00C5\u0064\u0307\u0327 michael@0: = {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D}{COMBINING DOT ABOVE}{COMBINING CEDILLA} michael@0: 6: \u00C5\u0064\u0327\u0307 michael@0: = {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D}{COMBINING CEDILLA}{COMBINING DOT ABOVE} michael@0: 7: \u00C5\u1E0B\u0327 michael@0: = {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D WITH DOT ABOVE}{COMBINING CEDILLA} michael@0: 8: \u00C5\u1E11\u0307 michael@0: = {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D WITH CEDILLA}{COMBINING DOT ABOVE} michael@0: 9: \u212B\u0064\u0307\u0327 michael@0: = {ANGSTROM SIGN}{LATIN SMALL LETTER D}{COMBINING DOT ABOVE}{COMBINING CEDILLA} michael@0: 10: \u212B\u0064\u0327\u0307 michael@0: = {ANGSTROM SIGN}{LATIN SMALL LETTER D}{COMBINING CEDILLA}{COMBINING DOT ABOVE} michael@0: 11: \u212B\u1E0B\u0327 michael@0: = {ANGSTROM SIGN}{LATIN SMALL LETTER D WITH DOT ABOVE}{COMBINING CEDILLA} michael@0: 12: \u212B\u1E11\u0307 michael@0: = {ANGSTROM SIGN}{LATIN SMALL LETTER D WITH CEDILLA}{COMBINING DOT ABOVE} michael@0: *
Note: the code is intended for use with small strings, and is not suitable for larger ones, michael@0: * since it has not been optimized for that situation. michael@0: *@author M. Davis michael@0: *@draft michael@0: */ michael@0: michael@0: // public michael@0: michael@0: U_NAMESPACE_BEGIN michael@0: michael@0: // TODO: add boilerplate methods. michael@0: michael@0: UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CanonicalIterator) michael@0: michael@0: /** michael@0: *@param source string to get results for michael@0: */ michael@0: CanonicalIterator::CanonicalIterator(const UnicodeString &sourceStr, UErrorCode &status) : michael@0: pieces(NULL), michael@0: pieces_length(0), michael@0: pieces_lengths(NULL), michael@0: current(NULL), michael@0: current_length(0), michael@0: nfd(*Normalizer2Factory::getNFDInstance(status)), michael@0: nfcImpl(*Normalizer2Factory::getNFCImpl(status)) michael@0: { michael@0: if(U_SUCCESS(status) && nfcImpl.ensureCanonIterData(status)) { michael@0: setSource(sourceStr, status); michael@0: } michael@0: } michael@0: michael@0: CanonicalIterator::~CanonicalIterator() { michael@0: cleanPieces(); michael@0: } michael@0: michael@0: void CanonicalIterator::cleanPieces() { michael@0: int32_t i = 0; michael@0: if(pieces != NULL) { michael@0: for(i = 0; i < pieces_length; i++) { michael@0: if(pieces[i] != NULL) { michael@0: delete[] pieces[i]; michael@0: } michael@0: } michael@0: uprv_free(pieces); michael@0: pieces = NULL; michael@0: pieces_length = 0; michael@0: } michael@0: if(pieces_lengths != NULL) { michael@0: uprv_free(pieces_lengths); michael@0: pieces_lengths = NULL; michael@0: } michael@0: if(current != NULL) { michael@0: uprv_free(current); michael@0: current = NULL; michael@0: current_length = 0; michael@0: } michael@0: } michael@0: michael@0: /** michael@0: *@return gets the source: NOTE: it is the NFD form of source michael@0: */ michael@0: UnicodeString CanonicalIterator::getSource() { michael@0: return source; michael@0: } michael@0: michael@0: /** michael@0: * Resets the iterator so that one can start again from the beginning. michael@0: */ michael@0: void CanonicalIterator::reset() { michael@0: done = FALSE; michael@0: for (int i = 0; i < current_length; ++i) { michael@0: current[i] = 0; michael@0: } michael@0: } michael@0: michael@0: /** michael@0: *@return the next string that is canonically equivalent. The value null is returned when michael@0: * the iteration is done. michael@0: */ michael@0: UnicodeString CanonicalIterator::next() { michael@0: int32_t i = 0; michael@0: michael@0: if (done) { michael@0: buffer.setToBogus(); michael@0: return buffer; michael@0: } michael@0: michael@0: // delete old contents michael@0: buffer.remove(); michael@0: michael@0: // construct return value michael@0: michael@0: for (i = 0; i < pieces_length; ++i) { michael@0: buffer.append(pieces[i][current[i]]); michael@0: } michael@0: //String result = buffer.toString(); // not needed michael@0: michael@0: // find next value for next time michael@0: michael@0: for (i = current_length - 1; ; --i) { michael@0: if (i < 0) { michael@0: done = TRUE; michael@0: break; michael@0: } michael@0: current[i]++; michael@0: if (current[i] < pieces_lengths[i]) break; // got sequence michael@0: current[i] = 0; michael@0: } michael@0: return buffer; michael@0: } michael@0: michael@0: /** michael@0: *@param set the source string to iterate against. This allows the same iterator to be used michael@0: * while changing the source string, saving object creation. michael@0: */ michael@0: void CanonicalIterator::setSource(const UnicodeString &newSource, UErrorCode &status) { michael@0: int32_t list_length = 0; michael@0: UChar32 cp = 0; michael@0: int32_t start = 0; michael@0: int32_t i = 0; michael@0: UnicodeString *list = NULL; michael@0: michael@0: nfd.normalize(newSource, source, status); michael@0: if(U_FAILURE(status)) { michael@0: return; michael@0: } michael@0: done = FALSE; michael@0: michael@0: cleanPieces(); michael@0: michael@0: // catch degenerate case michael@0: if (newSource.length() == 0) { michael@0: pieces = (UnicodeString **)uprv_malloc(sizeof(UnicodeString *)); michael@0: pieces_lengths = (int32_t*)uprv_malloc(1 * sizeof(int32_t)); michael@0: pieces_length = 1; michael@0: current = (int32_t*)uprv_malloc(1 * sizeof(int32_t)); michael@0: current_length = 1; michael@0: if (pieces == NULL || pieces_lengths == NULL || current == NULL) { michael@0: status = U_MEMORY_ALLOCATION_ERROR; michael@0: goto CleanPartialInitialization; michael@0: } michael@0: current[0] = 0; michael@0: pieces[0] = new UnicodeString[1]; michael@0: pieces_lengths[0] = 1; michael@0: if (pieces[0] == 0) { michael@0: status = U_MEMORY_ALLOCATION_ERROR; michael@0: goto CleanPartialInitialization; michael@0: } michael@0: return; michael@0: } michael@0: michael@0: michael@0: list = new UnicodeString[source.length()]; michael@0: if (list == 0) { michael@0: status = U_MEMORY_ALLOCATION_ERROR; michael@0: goto CleanPartialInitialization; michael@0: } michael@0: michael@0: // i should initialy be the number of code units at the michael@0: // start of the string michael@0: i = U16_LENGTH(source.char32At(0)); michael@0: //int32_t i = 1; michael@0: // find the segments michael@0: // This code iterates through the source string and michael@0: // extracts segments that end up on a codepoint that michael@0: // doesn't start any decompositions. (Analysis is done michael@0: // on the NFD form - see above). michael@0: for (; i < source.length(); i += U16_LENGTH(cp)) { michael@0: cp = source.char32At(i); michael@0: if (nfcImpl.isCanonSegmentStarter(cp)) { michael@0: source.extract(start, i-start, list[list_length++]); // add up to i michael@0: start = i; michael@0: } michael@0: } michael@0: source.extract(start, i-start, list[list_length++]); // add last one michael@0: michael@0: michael@0: // allocate the arrays, and find the strings that are CE to each segment michael@0: pieces = (UnicodeString **)uprv_malloc(list_length * sizeof(UnicodeString *)); michael@0: pieces_length = list_length; michael@0: pieces_lengths = (int32_t*)uprv_malloc(list_length * sizeof(int32_t)); michael@0: current = (int32_t*)uprv_malloc(list_length * sizeof(int32_t)); michael@0: current_length = list_length; michael@0: if (pieces == NULL || pieces_lengths == NULL || current == NULL) { michael@0: status = U_MEMORY_ALLOCATION_ERROR; michael@0: goto CleanPartialInitialization; michael@0: } michael@0: michael@0: for (i = 0; i < current_length; i++) { michael@0: current[i] = 0; michael@0: } michael@0: // for each segment, get all the combinations that can produce michael@0: // it after NFD normalization michael@0: for (i = 0; i < pieces_length; ++i) { michael@0: //if (PROGRESS) printf("SEGMENT\n"); michael@0: pieces[i] = getEquivalents(list[i], pieces_lengths[i], status); michael@0: } michael@0: michael@0: delete[] list; michael@0: return; michael@0: // Common section to cleanup all local variables and reset object variables. michael@0: CleanPartialInitialization: michael@0: if (list != NULL) { michael@0: delete[] list; michael@0: } michael@0: cleanPieces(); michael@0: } michael@0: michael@0: /** michael@0: * Dumb recursive implementation of permutation. michael@0: * TODO: optimize michael@0: * @param source the string to find permutations for michael@0: * @return the results in a set. michael@0: */ michael@0: void U_EXPORT2 CanonicalIterator::permute(UnicodeString &source, UBool skipZeros, Hashtable *result, UErrorCode &status) { michael@0: if(U_FAILURE(status)) { michael@0: return; michael@0: } michael@0: //if (PROGRESS) printf("Permute: %s\n", UToS(Tr(source))); michael@0: int32_t i = 0; michael@0: michael@0: // optimization: michael@0: // if zero or one character, just return a set with it michael@0: // we check for length < 2 to keep from counting code points all the time michael@0: if (source.length() <= 2 && source.countChar32() <= 1) { michael@0: UnicodeString *toPut = new UnicodeString(source); michael@0: /* test for NULL */ michael@0: if (toPut == 0) { michael@0: status = U_MEMORY_ALLOCATION_ERROR; michael@0: return; michael@0: } michael@0: result->put(source, toPut, status); michael@0: return; michael@0: } michael@0: michael@0: // otherwise iterate through the string, and recursively permute all the other characters michael@0: UChar32 cp; michael@0: Hashtable subpermute(status); michael@0: if(U_FAILURE(status)) { michael@0: return; michael@0: } michael@0: subpermute.setValueDeleter(uprv_deleteUObject); michael@0: michael@0: for (i = 0; i < source.length(); i += U16_LENGTH(cp)) { michael@0: cp = source.char32At(i); michael@0: const UHashElement *ne = NULL; michael@0: int32_t el = -1; michael@0: UnicodeString subPermuteString = source; michael@0: michael@0: // optimization: michael@0: // if the character is canonical combining class zero, michael@0: // don't permute it michael@0: if (skipZeros && i != 0 && u_getCombiningClass(cp) == 0) { michael@0: //System.out.println("Skipping " + Utility.hex(UTF16.valueOf(source, i))); michael@0: continue; michael@0: } michael@0: michael@0: subpermute.removeAll(); michael@0: michael@0: // see what the permutations of the characters before and after this one are michael@0: //Hashtable *subpermute = permute(source.substring(0,i) + source.substring(i + UTF16.getCharCount(cp))); michael@0: permute(subPermuteString.replace(i, U16_LENGTH(cp), NULL, 0), skipZeros, &subpermute, status); michael@0: /* Test for buffer overflows */ michael@0: if(U_FAILURE(status)) { michael@0: return; michael@0: } michael@0: // The upper replace is destructive. The question is do we have to make a copy, or we don't care about the contents michael@0: // of source at this point. michael@0: michael@0: // prefix this character to all of them michael@0: ne = subpermute.nextElement(el); michael@0: while (ne != NULL) { michael@0: UnicodeString *permRes = (UnicodeString *)(ne->value.pointer); michael@0: UnicodeString *chStr = new UnicodeString(cp); michael@0: //test for NULL michael@0: if (chStr == NULL) { michael@0: status = U_MEMORY_ALLOCATION_ERROR; michael@0: return; michael@0: } michael@0: chStr->append(*permRes); //*((UnicodeString *)(ne->value.pointer)); michael@0: //if (PROGRESS) printf(" Piece: %s\n", UToS(*chStr)); michael@0: result->put(*chStr, chStr, status); michael@0: ne = subpermute.nextElement(el); michael@0: } michael@0: } michael@0: //return result; michael@0: } michael@0: michael@0: // privates michael@0: michael@0: // we have a segment, in NFD. Find all the strings that are canonically equivalent to it. michael@0: UnicodeString* CanonicalIterator::getEquivalents(const UnicodeString &segment, int32_t &result_len, UErrorCode &status) { michael@0: Hashtable result(status); michael@0: Hashtable permutations(status); michael@0: Hashtable basic(status); michael@0: if (U_FAILURE(status)) { michael@0: return 0; michael@0: } michael@0: result.setValueDeleter(uprv_deleteUObject); michael@0: permutations.setValueDeleter(uprv_deleteUObject); michael@0: basic.setValueDeleter(uprv_deleteUObject); michael@0: michael@0: UChar USeg[256]; michael@0: int32_t segLen = segment.extract(USeg, 256, status); michael@0: getEquivalents2(&basic, USeg, segLen, status); michael@0: michael@0: // now get all the permutations michael@0: // add only the ones that are canonically equivalent michael@0: // TODO: optimize by not permuting any class zero. michael@0: michael@0: const UHashElement *ne = NULL; michael@0: int32_t el = -1; michael@0: //Iterator it = basic.iterator(); michael@0: ne = basic.nextElement(el); michael@0: //while (it.hasNext()) michael@0: while (ne != NULL) { michael@0: //String item = (String) it.next(); michael@0: UnicodeString item = *((UnicodeString *)(ne->value.pointer)); michael@0: michael@0: permutations.removeAll(); michael@0: permute(item, CANITER_SKIP_ZEROES, &permutations, status); michael@0: const UHashElement *ne2 = NULL; michael@0: int32_t el2 = -1; michael@0: //Iterator it2 = permutations.iterator(); michael@0: ne2 = permutations.nextElement(el2); michael@0: //while (it2.hasNext()) michael@0: while (ne2 != NULL) { michael@0: //String possible = (String) it2.next(); michael@0: //UnicodeString *possible = new UnicodeString(*((UnicodeString *)(ne2->value.pointer))); michael@0: UnicodeString possible(*((UnicodeString *)(ne2->value.pointer))); michael@0: UnicodeString attempt; michael@0: nfd.normalize(possible, attempt, status); michael@0: michael@0: // TODO: check if operator == is semanticaly the same as attempt.equals(segment) michael@0: if (attempt==segment) { michael@0: //if (PROGRESS) printf("Adding Permutation: %s\n", UToS(Tr(*possible))); michael@0: // TODO: use the hashtable just to catch duplicates - store strings directly (somehow). michael@0: result.put(possible, new UnicodeString(possible), status); //add(possible); michael@0: } else { michael@0: //if (PROGRESS) printf("-Skipping Permutation: %s\n", UToS(Tr(*possible))); michael@0: } michael@0: michael@0: ne2 = permutations.nextElement(el2); michael@0: } michael@0: ne = basic.nextElement(el); michael@0: } michael@0: michael@0: /* Test for buffer overflows */ michael@0: if(U_FAILURE(status)) { michael@0: return 0; michael@0: } michael@0: // convert into a String[] to clean up storage michael@0: //String[] finalResult = new String[result.size()]; michael@0: UnicodeString *finalResult = NULL; michael@0: int32_t resultCount; michael@0: if((resultCount = result.count())) { michael@0: finalResult = new UnicodeString[resultCount]; michael@0: if (finalResult == 0) { michael@0: status = U_MEMORY_ALLOCATION_ERROR; michael@0: return NULL; michael@0: } michael@0: } michael@0: else { michael@0: status = U_ILLEGAL_ARGUMENT_ERROR; michael@0: return NULL; michael@0: } michael@0: //result.toArray(finalResult); michael@0: result_len = 0; michael@0: el = -1; michael@0: ne = result.nextElement(el); michael@0: while(ne != NULL) { michael@0: finalResult[result_len++] = *((UnicodeString *)(ne->value.pointer)); michael@0: ne = result.nextElement(el); michael@0: } michael@0: michael@0: michael@0: return finalResult; michael@0: } michael@0: michael@0: Hashtable *CanonicalIterator::getEquivalents2(Hashtable *fillinResult, const UChar *segment, int32_t segLen, UErrorCode &status) { michael@0: michael@0: if (U_FAILURE(status)) { michael@0: return NULL; michael@0: } michael@0: michael@0: //if (PROGRESS) printf("Adding: %s\n", UToS(Tr(segment))); michael@0: michael@0: UnicodeString toPut(segment, segLen); michael@0: michael@0: fillinResult->put(toPut, new UnicodeString(toPut), status); michael@0: michael@0: UnicodeSet starts; michael@0: michael@0: // cycle through all the characters michael@0: UChar32 cp; michael@0: for (int32_t i = 0; i < segLen; i += U16_LENGTH(cp)) { michael@0: // see if any character is at the start of some decomposition michael@0: U16_GET(segment, 0, i, segLen, cp); michael@0: if (!nfcImpl.getCanonStartSet(cp, starts)) { michael@0: continue; michael@0: } michael@0: // if so, see which decompositions match michael@0: UnicodeSetIterator iter(starts); michael@0: while (iter.next()) { michael@0: UChar32 cp2 = iter.getCodepoint(); michael@0: Hashtable remainder(status); michael@0: remainder.setValueDeleter(uprv_deleteUObject); michael@0: if (extract(&remainder, cp2, segment, segLen, i, status) == NULL) { michael@0: continue; michael@0: } michael@0: michael@0: // there were some matches, so add all the possibilities to the set. michael@0: UnicodeString prefix(segment, i); michael@0: prefix += cp2; michael@0: michael@0: int32_t el = -1; michael@0: const UHashElement *ne = remainder.nextElement(el); michael@0: while (ne != NULL) { michael@0: UnicodeString item = *((UnicodeString *)(ne->value.pointer)); michael@0: UnicodeString *toAdd = new UnicodeString(prefix); michael@0: /* test for NULL */ michael@0: if (toAdd == 0) { michael@0: status = U_MEMORY_ALLOCATION_ERROR; michael@0: return NULL; michael@0: } michael@0: *toAdd += item; michael@0: fillinResult->put(*toAdd, toAdd, status); michael@0: michael@0: //if (PROGRESS) printf("Adding: %s\n", UToS(Tr(*toAdd))); michael@0: michael@0: ne = remainder.nextElement(el); michael@0: } michael@0: } michael@0: } michael@0: michael@0: /* Test for buffer overflows */ michael@0: if(U_FAILURE(status)) { michael@0: return NULL; michael@0: } michael@0: return fillinResult; michael@0: } michael@0: michael@0: /** michael@0: * See if the decomposition of cp2 is at segment starting at segmentPos michael@0: * (with canonical rearrangment!) michael@0: * If so, take the remainder, and return the equivalents michael@0: */ michael@0: Hashtable *CanonicalIterator::extract(Hashtable *fillinResult, UChar32 comp, const UChar *segment, int32_t segLen, int32_t segmentPos, UErrorCode &status) { michael@0: //Hashtable *CanonicalIterator::extract(UChar32 comp, const UnicodeString &segment, int32_t segLen, int32_t segmentPos, UErrorCode &status) { michael@0: //if (PROGRESS) printf(" extract: %s, ", UToS(Tr(UnicodeString(comp)))); michael@0: //if (PROGRESS) printf("%s, %i\n", UToS(Tr(segment)), segmentPos); michael@0: michael@0: if (U_FAILURE(status)) { michael@0: return NULL; michael@0: } michael@0: michael@0: UnicodeString temp(comp); michael@0: int32_t inputLen=temp.length(); michael@0: UnicodeString decompString; michael@0: nfd.normalize(temp, decompString, status); michael@0: const UChar *decomp=decompString.getBuffer(); michael@0: int32_t decompLen=decompString.length(); michael@0: michael@0: // See if it matches the start of segment (at segmentPos) michael@0: UBool ok = FALSE; michael@0: UChar32 cp; michael@0: int32_t decompPos = 0; michael@0: UChar32 decompCp; michael@0: U16_NEXT(decomp, decompPos, decompLen, decompCp); michael@0: michael@0: int32_t i = segmentPos; michael@0: while(i < segLen) { michael@0: U16_NEXT(segment, i, segLen, cp); michael@0: michael@0: if (cp == decompCp) { // if equal, eat another cp from decomp michael@0: michael@0: //if (PROGRESS) printf(" matches: %s\n", UToS(Tr(UnicodeString(cp)))); michael@0: michael@0: if (decompPos == decompLen) { // done, have all decomp characters! michael@0: temp.append(segment+i, segLen-i); michael@0: ok = TRUE; michael@0: break; michael@0: } michael@0: U16_NEXT(decomp, decompPos, decompLen, decompCp); michael@0: } else { michael@0: //if (PROGRESS) printf(" buffer: %s\n", UToS(Tr(UnicodeString(cp)))); michael@0: michael@0: // brute force approach michael@0: temp.append(cp); michael@0: michael@0: /* TODO: optimize michael@0: // since we know that the classes are monotonically increasing, after zero michael@0: // e.g. 0 5 7 9 0 3 michael@0: // we can do an optimization michael@0: // there are only a few cases that work: zero, less, same, greater michael@0: // if both classes are the same, we fail michael@0: // if the decomp class < the segment class, we fail michael@0: michael@0: segClass = getClass(cp); michael@0: if (decompClass <= segClass) return null; michael@0: */ michael@0: } michael@0: } michael@0: if (!ok) michael@0: return NULL; // we failed, characters left over michael@0: michael@0: //if (PROGRESS) printf("Matches\n"); michael@0: michael@0: if (inputLen == temp.length()) { michael@0: fillinResult->put(UnicodeString(), new UnicodeString(), status); michael@0: return fillinResult; // succeed, but no remainder michael@0: } michael@0: michael@0: // brute force approach michael@0: // check to make sure result is canonically equivalent michael@0: UnicodeString trial; michael@0: nfd.normalize(temp, trial, status); michael@0: if(U_FAILURE(status) || trial.compare(segment+segmentPos, segLen - segmentPos) != 0) { michael@0: return NULL; michael@0: } michael@0: michael@0: return getEquivalents2(fillinResult, temp.getBuffer()+inputLen, temp.length()-inputLen, status); michael@0: } michael@0: michael@0: U_NAMESPACE_END michael@0: michael@0: #endif /* #if !UCONFIG_NO_NORMALIZATION */