X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b75a7d8f3b4adbae880cab104ce2c6a50eee4db2..4f1e1a09ce4daed860e35d359ce2fceccb0764e8:/icuSources/test/intltest/nptrans.cpp?ds=sidebyside diff --git a/icuSources/test/intltest/nptrans.cpp b/icuSources/test/intltest/nptrans.cpp index c796521b..6c1c7be3 100644 --- a/icuSources/test/intltest/nptrans.cpp +++ b/icuSources/test/intltest/nptrans.cpp @@ -1,12 +1,14 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * - * Copyright (C) 2003, International Business Machines + * Copyright (C) 2003-2014, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* * file name: nptrans.h - * encoding: US-ASCII + * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -27,7 +29,7 @@ #include "ustr_imp.h" #include "intltest.h" -#ifdef DEBUG +#ifdef NPTRANS_DEBUG #include #endif @@ -63,8 +65,11 @@ NamePrepTransform::NamePrepTransform(UParseError& parseError, UErrorCode& status // create the mapping transliterator int32_t ruleLen = 0; const UChar* ruleUChar = ures_getStringByKey(bundle, "MapNFKC",&ruleLen, &status); - UnicodeString rule(ruleUChar, ruleLen); - + int32_t mapRuleLen = 0; + const UChar *mapRuleUChar = ures_getStringByKey(bundle, "MapNoNormalization", &mapRuleLen, &status); + UnicodeString rule(mapRuleUChar, mapRuleLen); + rule.append(ruleUChar, ruleLen); + mapping = Transliterator::createFromRules(UnicodeString("NamePrepTransform", ""), rule, UTRANS_FORWARD, parseError,status); if(U_FAILURE(status)) { @@ -81,14 +86,14 @@ NamePrepTransform::NamePrepTransform(UParseError& parseError, UErrorCode& status pattern = ures_getStringByKey(bundle,"ProhibitedSet",&patternLen, &status); UnicodeString test(pattern,patternLen); prohibited.applyPattern(test,status); -#ifdef DEBUG +#ifdef NPTRANS_DEBUG if(U_FAILURE(status)){ printf("Construction of Unicode set failed\n"); } if(U_SUCCESS(status)){ if(prohibited.contains((UChar) 0x644)){ - printf("The string contains 0x644 ... damn !!\n"); + printf("The string contains 0x644 ... !!\n"); } UnicodeString temp; prohibited.toPattern(temp,TRUE); @@ -162,15 +167,14 @@ int32_t NamePrepTransform::map(const UChar* src, int32_t srcLength, for(;bufIndex