From 5aaacb9233b0ddb6d4db548aab04daa536ef8dcd Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Fri, 30 May 2008 01:38:04 +0000 Subject: [PATCH] ICU-6157 remove ASCIIism X-SVN-Rev: 24083 --- icu4c/source/i18n/dtitvinf.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/icu4c/source/i18n/dtitvinf.cpp b/icu4c/source/i18n/dtitvinf.cpp index b69c757e592..896b29348ef 100644 --- a/icu4c/source/i18n/dtitvinf.cpp +++ b/icu4c/source/i18n/dtitvinf.cpp @@ -386,6 +386,8 @@ DateIntervalInfo::getBestSkeleton(const UnicodeString& skeleton, const int32_t DIFFERENT_FIELD = 0x1000; const int32_t STRING_NUMERIC_DIFFERENCE = 0x100; const int32_t BASE = 0x41; + const UChar CHAR_V = 0x0076; + const UChar CHAR_Z = 0x007A; // hack for 'v' and 'z'. // resource bundle only have time skeletons ending with 'v', @@ -393,9 +395,15 @@ DateIntervalInfo::getBestSkeleton(const UnicodeString& skeleton, UBool replaceZWithV = false; const UnicodeString* inputSkeleton = &skeleton; UnicodeString copySkeleton; - if ( skeleton.indexOf('z') != -1 ) { + if ( skeleton.indexOf(CHAR_Z) != -1 ) { + UChar zstr[2]; + UChar vstr[2]; + zstr[0]=CHAR_Z; + vstr[0]=CHAR_V; + zstr[1]=0; + vstr[1]=0; copySkeleton = skeleton; - copySkeleton.findAndReplace("z", "v"); + copySkeleton.findAndReplace(zstr, vstr); inputSkeleton = ©Skeleton; replaceZWithV = true; }