/*
**********************************************************************
-* Copyright (C) 1999-2008, International Business Machines
+* Copyright (C) 1999-2011, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
static const UChar ID_DELIM = 0x003B; /*;*/
static const UChar NEWLINE = 10;
-// Empty string
-static const UChar EMPTY[] = {0}; //""
static const UChar COLON_COLON[] = {0x3A, 0x3A, 0}; //"::"
U_NAMESPACE_BEGIN
CompoundTransliterator::CompoundTransliterator(UVector& list,
UParseError& /*parseError*/,
UErrorCode& status) :
- Transliterator(EMPTY, NULL),
+ Transliterator(UnicodeString(), NULL),
trans(0), numAnonymousRBTs(0)
{
// TODO add code for parseError...currently unused, but
int32_t anonymousRBTs,
UParseError& /*parseError*/,
UErrorCode& status) :
- Transliterator(EMPTY, NULL),
+ Transliterator(UnicodeString(), NULL),
trans(0), numAnonymousRBTs(anonymousRBTs)
{
init(list, UTRANS_FORWARD, FALSE, status);
// If we are a compound RBT and if we have a global
// filter, then emit it at the top.
UnicodeString pat;
- rulesSource.append(COLON_COLON).append(getFilter()->toPattern(pat, escapeUnprintable)).append(ID_DELIM);
+ rulesSource.append(COLON_COLON, 2).append(getFilter()->toPattern(pat, escapeUnprintable)).append(ID_DELIM);
}
for (int32_t i=0; i<count; ++i) {
UnicodeString rule;
// ::BEGIN/::END blocks) are given IDs that begin with
// "%Pass": use toRules() to write all the rules to the output
// (and insert "::Null;" if we have two in a row)
- if (trans[i]->getID().startsWith(PASS_STRING)) {
+ if (trans[i]->getID().startsWith(PASS_STRING, 5)) {
trans[i]->toRules(rule, escapeUnprintable);
- if (numAnonymousRBTs > 1 && i > 0 && trans[i - 1]->getID().startsWith(PASS_STRING))
+ if (numAnonymousRBTs > 1 && i > 0 && trans[i - 1]->getID().startsWith(PASS_STRING, 5))
rule = UNICODE_STRING_SIMPLE("::Null;") + rule;
// we also use toRules() on CompoundTransliterators (which we