6
6
#include " RuntimePlatformAgnosticPch.h"
7
7
#include " UnicodeText.h"
8
8
#ifdef HAS_REAL_ICU
9
+ #define U_USING_ICU_NAMESPACE 0
9
10
#include < unicode/uchar.h>
10
11
#include < unicode/ustring.h>
11
12
#include < unicode/normalizer2.h>
@@ -31,24 +32,24 @@ namespace PlatformAgnostic
31
32
32
33
#ifdef HAS_REAL_ICU
33
34
// Helper ICU conversion facilities
34
- static const Normalizer2* TranslateToICUNormalizer (NormalizationForm normalizationForm)
35
+ static const icu:: Normalizer2* TranslateToICUNormalizer (NormalizationForm normalizationForm)
35
36
{
36
37
UErrorCode errorCode = U_ZERO_ERROR;
37
- const Normalizer2* normalizer;
38
+ const icu:: Normalizer2* normalizer;
38
39
39
40
switch (normalizationForm)
40
41
{
41
42
case NormalizationForm::C:
42
- normalizer = Normalizer2::getNFCInstance (errorCode);
43
+ normalizer = icu:: Normalizer2::getNFCInstance (errorCode);
43
44
break ;
44
45
case NormalizationForm::D:
45
- normalizer = Normalizer2::getNFDInstance (errorCode);
46
+ normalizer = icu:: Normalizer2::getNFDInstance (errorCode);
46
47
break ;
47
48
case NormalizationForm::KC:
48
- normalizer = Normalizer2::getNFKCInstance (errorCode);
49
+ normalizer = icu:: Normalizer2::getNFKCInstance (errorCode);
49
50
break ;
50
51
case NormalizationForm::KD:
51
- normalizer = Normalizer2::getNFKDInstance (errorCode);
52
+ normalizer = icu:: Normalizer2::getNFKDInstance (errorCode);
52
53
break ;
53
54
default :
54
55
AssertMsg (false , " Unsupported normalization form" );
@@ -157,13 +158,13 @@ namespace PlatformAgnostic
157
158
return -1 * invalidIndex; // mimicking the behavior of Win32 NormalizeString
158
159
}
159
160
160
- const Normalizer2* normalizer = TranslateToICUNormalizer (normalizationForm);
161
+ const icu:: Normalizer2* normalizer = TranslateToICUNormalizer (normalizationForm);
161
162
Assert (normalizer != nullptr );
162
163
163
- const UnicodeString sourceUniStr ((const UChar*) sourceString, sourceLength);
164
+ const icu:: UnicodeString sourceUniStr ((const UChar*) sourceString, sourceLength);
164
165
165
166
UErrorCode errorCode = U_ZERO_ERROR;
166
- const UnicodeString destUniStr = normalizer->normalize (sourceUniStr, errorCode);
167
+ const icu:: UnicodeString destUniStr = normalizer->normalize (sourceUniStr, errorCode);
167
168
168
169
if (U_FAILURE (errorCode))
169
170
{
@@ -208,10 +209,10 @@ namespace PlatformAgnostic
208
209
return false ;
209
210
}
210
211
211
- const Normalizer2* normalizer = TranslateToICUNormalizer (normalizationForm);
212
+ const icu:: Normalizer2* normalizer = TranslateToICUNormalizer (normalizationForm);
212
213
Assert (normalizer != nullptr );
213
214
214
- const UnicodeString testUniStr ((const UChar*) testString, length);
215
+ const icu:: UnicodeString testUniStr ((const UChar*) testString, length);
215
216
bool isNormalized = normalizer->isNormalized (testUniStr, errorCode);
216
217
217
218
Assert (U_SUCCESS (errorCode));
0 commit comments