X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/374ca955a76ecab1204ca8bfa63ff9238d998416..ba516feee23ef0c2b810ac6365e88f33807caaa8:/icuSources/common/unifilt.cpp?ds=inline diff --git a/icuSources/common/unifilt.cpp b/icuSources/common/unifilt.cpp index 69ac3070..856e5b97 100644 --- a/icuSources/common/unifilt.cpp +++ b/icuSources/common/unifilt.cpp @@ -1,6 +1,6 @@ /* ********************************************************************** -* Copyright (c) 2001-2004, International Business Machines +* Copyright (c) 2001-2011, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * Date Name Description @@ -10,6 +10,7 @@ #include "unicode/unifilt.h" #include "unicode/rep.h" +#include "unicode/utf16.h" U_NAMESPACE_BEGIN UOBJECT_DEFINE_ABSTRACT_RTTI_IMPLEMENTATION(UnicodeFilter) @@ -43,7 +44,7 @@ UMatchDegree UnicodeFilter::matches(const Replaceable& text, UChar32 c; if (offset < limit && contains(c = text.char32At(offset))) { - offset += UTF_CHAR_LENGTH(c); + offset += U16_LENGTH(c); return U_MATCH; } if (offset > limit && @@ -53,7 +54,7 @@ UMatchDegree UnicodeFilter::matches(const Replaceable& text, // the lead surrogate). --offset; if (offset >= 0) { - offset -= UTF_CHAR_LENGTH(text.char32At(offset)) - 1; + offset -= U16_LENGTH(text.char32At(offset)) - 1; } return U_MATCH; }