From a2af700b96258b04b010732a1b4a318b9230ff83 Mon Sep 17 00:00:00 2001 From: Vladimir Weinstein Date: Wed, 9 Jun 2004 06:01:39 +0000 Subject: [PATCH] ICU-3100 fix assertion failure on 400 due to usage of variant chars X-SVN-Rev: 15810 --- icu4c/source/i18n/ucol_sit.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/icu4c/source/i18n/ucol_sit.cpp b/icu4c/source/i18n/ucol_sit.cpp index 2e2f6a84227..9cd4c50ff61 100644 --- a/icu4c/source/i18n/ucol_sit.cpp +++ b/icu4c/source/i18n/ucol_sit.cpp @@ -21,7 +21,6 @@ #include "cstring.h" - enum OptionsList { UCOL_SIT_LANGUAGE = 0, UCOL_SIT_SCRIPT, @@ -978,19 +977,23 @@ ucol_getContractions( const UCollator *coll, } + U_CAPI int32_t U_EXPORT2 ucol_getUnsafeSet( const UCollator *coll, USet *unsafe, UErrorCode *status) { + UChar buffer[internalBufferSize]; + int32_t len = 0; + uset_clear(unsafe); + // cccpattern = "[[:^tccc=0:][:^lccc=0:]]", unfortunately variant + static const UChar cccpattern[25] = { 0x5b, 0x5b, 0x3a, 0x5e, 0x74, 0x63, 0x63, 0x63, 0x3d, 0x30, 0x3a, 0x5d, + 0x5b, 0x3a, 0x5e, 0x6c, 0x63, 0x63, 0x63, 0x3d, 0x30, 0x3a, 0x5d, 0x5d, 0x00 }; + // add chars that fail the fcd check - UChar buffer[internalBufferSize]; - static const char* fcdUnsafes = "[[:^tccc=0:][:^lccc=0:]]"; - int32_t len = uprv_strlen(fcdUnsafes); - u_charsToUChars(fcdUnsafes, buffer, internalBufferSize); - uset_applyPattern(unsafe, buffer, len, USET_IGNORE_SPACE, status); + uset_applyPattern(unsafe, cccpattern, 24, USET_IGNORE_SPACE, status); // add Thai/Lao prevowels uset_addRange(unsafe, 0xe40, 0xe44);